Make saving dataset public (but do not log private models)
Browse files
README.md
CHANGED
@@ -9,7 +9,8 @@ app_file: app.py
|
|
9 |
pinned: true
|
10 |
license: apache-2.0
|
11 |
models: []
|
12 |
-
datasets:
|
|
|
13 |
---
|
14 |
|
15 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
9 |
pinned: true
|
10 |
license: apache-2.0
|
11 |
models: []
|
12 |
+
datasets:
|
13 |
+
- safetensors/conversions
|
14 |
---
|
15 |
|
16 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -28,11 +28,13 @@ def run(token: str, model_id: str) -> str:
|
|
28 |
"""
|
29 |
try:
|
30 |
api = HfApi(token=token)
|
|
|
|
|
31 |
commit_info = convert(api=api, model_id=model_id)
|
32 |
print("[commit_info]", commit_info)
|
33 |
|
34 |
-
# save in a
|
35 |
-
if repo is not None:
|
36 |
repo.git_pull(rebase=True)
|
37 |
with open(DATA_FILE, "a") as csvfile:
|
38 |
writer = csv.DictWriter(
|
|
|
28 |
"""
|
29 |
try:
|
30 |
api = HfApi(token=token)
|
31 |
+
is_private = api.model_info(model_id=model_id).private
|
32 |
+
|
33 |
commit_info = convert(api=api, model_id=model_id)
|
34 |
print("[commit_info]", commit_info)
|
35 |
|
36 |
+
# save in a (public) dataset:
|
37 |
+
if repo is not None and not is_private:
|
38 |
repo.git_pull(rebase=True)
|
39 |
with open(DATA_FILE, "a") as csvfile:
|
40 |
writer = csv.DictWriter(
|