Skip to content

Commit

Permalink
Minor improvements of downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Old-Shatterhand committed Feb 11, 2025
1 parent e367437 commit 91331e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions glycowork/glycan_data/loader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
import json
import pickle
import urllib.request
import pandas as pd
from pathlib import Path
from itertools import chain
Expand Down Expand Up @@ -253,7 +252,7 @@ def download_model(file_id: str, # Google Drive file ID
"Download the model weights file from Google Drive"
file_id = file_id.split('/d/')[1].split('/view')[0]
url = f'https://drive.google.com/uc?id={file_id}'
response = requests.get(url, stream=True)
response = requests.get(url, stream=True, timeout=10)
if response.status_code == 200:
with open(local_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
Expand Down

0 comments on commit 91331e7

Please sign in to comment.