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:
Josh Bennett 2024-10-10 04:42:59 -04:00 committed by GitHub
parent ea8675d473
commit 85a3cc8d8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: