Support HF_HUB_USER_AGENT_ORIGIN

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët 2025-03-05 10:59:01 +00:00
parent aadd624933
commit 8fe851209c
No known key found for this signature in database

View File

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