From 8fe851209c5c7c2cd23ccbac906f67f97ed75f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Wed, 5 Mar 2025 10:59:01 +0000 Subject: [PATCH] Support HF_HUB_USER_AGENT_ORIGIN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- backends/llamacpp/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backends/llamacpp/src/main.rs b/backends/llamacpp/src/main.rs index aceb86ef..b99e9591 100644 --- a/backends/llamacpp/src/main.rs +++ b/backends/llamacpp/src/main.rs @@ -211,6 +211,9 @@ async fn main() -> Result<(), RouterError> { if let Ok(token) = std::env::var("HF_TOKEN") { builder = builder.with_token(token.into()); } + if let Ok(origin) = std::env::var("HF_HUB_USER_AGENT_ORIGIN") { + builder = builder.with_user_agent("origin", origin.as_str()); + } builder }; let api_repo = api_builder().build()?.repo(Repo::with_revision(