Spaces:
Sleeping
Sleeping
fix: 文件下载
Browse files
api.py
CHANGED
@@ -42,6 +42,7 @@ if not os.path.exists(UPLOAD_DIRECTORY):
|
|
42 |
|
43 |
def download_file(url: str):
|
44 |
headers = {"Authorization": f"Bearer {HUGGINGFACE_API_TOKEN}"}
|
|
|
45 |
# with requests.get(url, stream=True,headers=headers) as response:
|
46 |
# for chunk in response.iter_content(chunk_size=1024): # 每次读取 1KB
|
47 |
# if chunk:
|
|
|
42 |
|
43 |
def download_file(url: str):
|
44 |
headers = {"Authorization": f"Bearer {HUGGINGFACE_API_TOKEN}"}
|
45 |
+
response = requests.get(url, headers=headers, stream=True)
|
46 |
# with requests.get(url, stream=True,headers=headers) as response:
|
47 |
# for chunk in response.iter_content(chunk_size=1024): # 每次读取 1KB
|
48 |
# if chunk:
|