mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
Add user-agent to download-model.py requests (#3243)
This commit is contained in:
parent
b2d5433409
commit
74fc5dd873
@ -4,7 +4,10 @@ import requests
|
|||||||
|
|
||||||
|
|
||||||
def download_single(url):
|
def download_single(url):
|
||||||
response = requests.get(url, timeout=5)
|
headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
|
||||||
|
}
|
||||||
|
response = requests.get(url, headers=headers, timeout=5)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.content
|
return response.content
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user