Spaces:
Sleeping
Sleeping
fix: print the info
Browse files
app.py
CHANGED
@@ -11,10 +11,10 @@ REVISION = os.getenv("REVISION")
|
|
11 |
TARGET = os.getenv("TARGET")
|
12 |
|
13 |
def func(hf_token, repo, revision, target_repo):
|
14 |
-
hf_token = hf_token if hf_token
|
15 |
-
repo = repo if repo
|
16 |
-
revision = revision if revision
|
17 |
-
target_repo = target_repo if target_repo
|
18 |
|
19 |
print('download the desired model locally ...')
|
20 |
hf_api.snapshot_download(
|
@@ -25,6 +25,8 @@ def func(hf_token, repo, revision, target_repo):
|
|
25 |
)
|
26 |
print(os.listdir(CURRENT_MODEL_PATH))
|
27 |
|
|
|
|
|
28 |
for file in os.listdir(CURRENT_MODEL_PATH):
|
29 |
print(f'uploading {file}')
|
30 |
with open(f"{CURRENT_MODEL_PATH}/{file}", "rb") as fobj:
|
|
|
11 |
TARGET = os.getenv("TARGET")
|
12 |
|
13 |
def func(hf_token, repo, revision, target_repo):
|
14 |
+
hf_token = hf_token if hf_token else HF_TOKEN
|
15 |
+
repo = repo if repo else REPO
|
16 |
+
revision = revision if revision else REVISION
|
17 |
+
target_repo = target_repo if target_repo else TARGET
|
18 |
|
19 |
print('download the desired model locally ...')
|
20 |
hf_api.snapshot_download(
|
|
|
25 |
)
|
26 |
print(os.listdir(CURRENT_MODEL_PATH))
|
27 |
|
28 |
+
print(f"The content of {repo}/{revision} has been copied to {target_repo}!" )
|
29 |
+
|
30 |
for file in os.listdir(CURRENT_MODEL_PATH):
|
31 |
print(f'uploading {file}')
|
32 |
with open(f"{CURRENT_MODEL_PATH}/{file}", "rb") as fobj:
|