Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,21 +32,8 @@ zip_path = "sample_evaluation.zip"
|
|
32 |
extract_path = "sample_evaluation"
|
33 |
unzip_file(zip_path, extract_path)
|
34 |
|
35 |
-
import
|
36 |
-
|
37 |
-
def download_file(url, output_file):
|
38 |
-
response = requests.get(url, stream=True)
|
39 |
-
response.raise_for_status() # Raises an HTTPError if the status is 4xx, 5xx
|
40 |
-
|
41 |
-
with open(output_file, 'wb') as file:
|
42 |
-
for chunk in response.iter_content(chunk_size=8192):
|
43 |
-
if chunk:
|
44 |
-
file.write(chunk)
|
45 |
-
|
46 |
-
# Example usage
|
47 |
-
url = "https://huggingface.co/safinal/compositional-retrieval/resolve/main/weights.pth"
|
48 |
-
output_file = "weights.pth"
|
49 |
-
download_file(url, output_file)
|
50 |
|
51 |
|
52 |
|
|
|
32 |
extract_path = "sample_evaluation"
|
33 |
unzip_file(zip_path, extract_path)
|
34 |
|
35 |
+
from huggingface_hub import hf_hub_download
|
36 |
+
hf_hub_download(repo_id="safinal/compositional-retrieval", filename="weights.pth", local_dir='.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
|
39 |
|