mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
feat(transformers): Use downloaded model for Transformers backend if it already exists. (#3777)
* signing commit Signed-off-by: Josh Bennett <562773+joshbtn@users.noreply.github.com> * Update transformers backend to check for existing model directory Signed-off-by: Josh Bennett <562773+joshbtn@users.noreply.github.com> --------- Signed-off-by: Josh Bennett <562773+joshbtn@users.noreply.github.com>
This commit is contained in:
parent
ea8675d473
commit
85a3cc8d8f
1 changed files with 5 additions and 0 deletions
|
@ -72,7 +72,12 @@ class BackendServicer(backend_pb2_grpc.BackendServicer):
|
||||||
Returns:
|
Returns:
|
||||||
A Result object that contains the result of the LoadModel operation.
|
A Result object that contains the result of the LoadModel operation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_name = request.Model
|
model_name = request.Model
|
||||||
|
|
||||||
|
# Check to see if the Model exists in the filesystem already.
|
||||||
|
if os.path.exists(request.ModelFile):
|
||||||
|
model_name = request.ModelFile
|
||||||
|
|
||||||
compute = torch.float16
|
compute = torch.float16
|
||||||
if request.F16Memory == True:
|
if request.F16Memory == True:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue