"vscode:/vscode.git/clone" did not exist on "ba6fd6eb30de97370f06f5804d9cc0e10b5718b5"
Unverified Commit 790a909b authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

[Single File] Add user agent to SF download requests. (#10979)

update
parent 54ab4753
...@@ -397,6 +397,7 @@ def load_single_file_checkpoint( ...@@ -397,6 +397,7 @@ def load_single_file_checkpoint(
else: else:
repo_id, weights_name = _extract_repo_id_and_weights_name(pretrained_model_link_or_path) repo_id, weights_name = _extract_repo_id_and_weights_name(pretrained_model_link_or_path)
user_agent = {"file_type": "single_file", "framework": "pytorch"}
pretrained_model_link_or_path = _get_model_file( pretrained_model_link_or_path = _get_model_file(
repo_id, repo_id,
weights_name=weights_name, weights_name=weights_name,
...@@ -406,6 +407,7 @@ def load_single_file_checkpoint( ...@@ -406,6 +407,7 @@ def load_single_file_checkpoint(
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
revision=revision, revision=revision,
user_agent=user_agent,
) )
checkpoint = load_state_dict(pretrained_model_link_or_path, disable_mmap=disable_mmap) checkpoint = load_state_dict(pretrained_model_link_or_path, disable_mmap=disable_mmap)
......
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