Fix hf_hub_download to handle nested directory structure
Browse files- chatbot/chat_server.py +4 -4
chatbot/chat_server.py
CHANGED
|
@@ -45,11 +45,11 @@ def download_heavy_files():
|
|
| 45 |
downloaded_path = hf_hub_download(
|
| 46 |
repo_id="freate16/glof-database",
|
| 47 |
repo_type="dataset",
|
| 48 |
-
filename=hf_filename
|
| 49 |
-
local_dir=str(local_path.parent),
|
| 50 |
-
local_dir_use_symlinks=False
|
| 51 |
)
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
except Exception as e:
|
| 54 |
print(f"CRITICAL ERROR: Failed to download '{hf_filename}' from your Dataset! Did you upload it? Error: {e}")
|
| 55 |
else:
|
|
|
|
| 45 |
downloaded_path = hf_hub_download(
|
| 46 |
repo_id="freate16/glof-database",
|
| 47 |
repo_type="dataset",
|
| 48 |
+
filename=hf_filename
|
|
|
|
|
|
|
| 49 |
)
|
| 50 |
+
import shutil
|
| 51 |
+
shutil.copy2(downloaded_path, local_path)
|
| 52 |
+
print(f"Successfully downloaded to {local_path}")
|
| 53 |
except Exception as e:
|
| 54 |
print(f"CRITICAL ERROR: Failed to download '{hf_filename}' from your Dataset! Did you upload it? Error: {e}")
|
| 55 |
else:
|