Unverified Commit 6487e9b3 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Send headers when converting safetensors (#30144)


Co-authored-by: default avatarWauplin <lucainp@gmail.com>
parent 08a194fc
......@@ -5,7 +5,7 @@ from typing import Optional
import requests
from huggingface_hub import Discussion, HfApi, get_repo_discussions
from .utils import cached_file, logging
from .utils import cached_file, http_user_agent, logging
logger = logging.get_logger(__name__)
......@@ -86,7 +86,7 @@ def get_conversion_pr_reference(api: HfApi, model_id: str, **kwargs):
def auto_conversion(pretrained_model_name_or_path: str, ignore_errors_during_conversion=False, **cached_file_kwargs):
try:
api = HfApi(token=cached_file_kwargs.get("token"))
api = HfApi(token=cached_file_kwargs.get("token"), headers=http_user_agent())
sha = get_conversion_pr_reference(api, pretrained_model_name_or_path, **cached_file_kwargs)
if sha is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment