Skip to content

Commit 29ea1c5

Browse files
committed
Integ test updates
1 parent 312d837 commit 29ea1c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sagemaker/serve/builder/tei_builder.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ def _tei_model_builder_deploy_wrapper(self, *args, **kwargs) -> Type[PredictorBa
168168
self.env_vars.update(env_vars)
169169
self.pysdk_model.env.update(self.env_vars)
170170

171+
# if the weights have been cached via local container mode -> set to offline
172+
if str(Mode.LOCAL_CONTAINER) in self.modes:
173+
self.pysdk_model.env.update({"TRANSFORMERS_OFFLINE": "1"})
174+
else:
175+
# if has not been built for local container we must use cache
176+
# that hosting has write access to.
177+
self.pysdk_model.env["TRANSFORMERS_CACHE"] = "/tmp"
178+
self.pysdk_model.env["HUGGINGFACE_HUB_CACHE"] = "/tmp"
179+
171180
if "endpoint_logging" not in kwargs:
172181
kwargs["endpoint_logging"] = True
173182

0 commit comments

Comments
 (0)