From 429a6adb85db4e325b23d1520130280037ddfac0 Mon Sep 17 00:00:00 2001 From: Daniel Levi-Minzi Date: Mon, 4 Nov 2024 12:15:54 -0500 Subject: [PATCH] login for hf token --- sdk/src/beta9/abstractions/integrations/vllm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/src/beta9/abstractions/integrations/vllm.py b/sdk/src/beta9/abstractions/integrations/vllm.py index eef720f59..206e4dbcc 100644 --- a/sdk/src/beta9/abstractions/integrations/vllm.py +++ b/sdk/src/beta9/abstractions/integrations/vllm.py @@ -330,6 +330,12 @@ def __call__(self, *args: Any, **kwargs: Any): f"{self.engine_config.download_dir}/{chat_template_filename}" ) + if "HF_TOKEN" in os.environ: + hf_token = os.environ["HF_TOKEN"] + import huggingface_hub + + huggingface_hub.login(hf_token) + app = FastAPI() @app.get("/health")