Spaces:
Running
on
Zero
Running
on
Zero
ekhatskevich
commited on
Commit
·
371bdca
1
Parent(s):
a7bee92
fix: tensors
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from scepter.modules.utils.file_system import FS
|
4 |
-
from huggingface_hub import hf_hub_download
|
5 |
|
6 |
def resolve_hf_path(path):
|
7 |
if isinstance(path, str) and path.startswith("hf://"):
|
@@ -17,7 +17,7 @@ def resolve_hf_path(path):
|
|
17 |
if token is None:
|
18 |
raise ValueError("HUGGINGFACE_HUB_TOKEN environment variable not set!")
|
19 |
# If filename is provided, download that file; otherwise, download the whole repo snapshot.
|
20 |
-
local_path = hf_hub_download(repo_id=repo_id, filename=filename, token=token) if filename else
|
21 |
return local_path
|
22 |
return path
|
23 |
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from scepter.modules.utils.file_system import FS
|
4 |
+
from huggingface_hub import hf_hub_download, snapshot_download
|
5 |
|
6 |
def resolve_hf_path(path):
|
7 |
if isinstance(path, str) and path.startswith("hf://"):
|
|
|
17 |
if token is None:
|
18 |
raise ValueError("HUGGINGFACE_HUB_TOKEN environment variable not set!")
|
19 |
# If filename is provided, download that file; otherwise, download the whole repo snapshot.
|
20 |
+
local_path = hf_hub_download(repo_id=repo_id, filename=filename, token=token) if filename else snapshot_download(repo_id=repo_id, token=token)
|
21 |
return local_path
|
22 |
return path
|
23 |
|