File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 66
77import requests
88from qiniu import Auth , put_file , put_stream_v2 , put_data
9+ from qiniu import config as qiniu_config
910from jinja2 import Environment , BaseLoader
1011from huggingface_hub import HfApi , hf_hub_url
1112from huggingface_hub .hf_api import RepoFolder
@@ -142,6 +143,10 @@ def upload_hf_repo(
142143
143144
144145if __name__ == '__main__' :
146+ # Configure longer timeout for large file uploads (5 minutes instead of default 30s)
147+ # This prevents TimeoutError when uploading large files like model.bin through qiniu's put_stream_v2
148+ qiniu_config .set_default (connection_timeout = 60 * 60 * 3 )
149+
145150 parser = argparse .ArgumentParser ()
146151 parser .add_argument ('--ak' , type = str , help = 'qiniu access key' )
147152 parser .add_argument ('--sk' , type = str , help = 'qiniu secret key' )
You can’t perform that action at this time.
0 commit comments