Spaces:
Running
Running
Add more logs to app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import csv
|
2 |
-
import datetime
|
3 |
import os
|
4 |
from typing import Optional
|
5 |
import gradio as gr
|
@@ -28,7 +28,8 @@ def run(token: str, model_id: str) -> str:
|
|
28 |
"""
|
29 |
try:
|
30 |
api = HfApi(token=token)
|
31 |
-
is_private = api.model_info(
|
|
|
32 |
|
33 |
commit_info = convert(api=api, model_id=model_id)
|
34 |
print("[commit_info]", commit_info)
|
@@ -36,6 +37,7 @@ def run(token: str, model_id: str) -> str:
|
|
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(
|
41 |
csvfile, fieldnames=["model_id", "pr_url", "time"]
|
|
|
1 |
import csv
|
2 |
+
from datetime import datetime
|
3 |
import os
|
4 |
from typing import Optional
|
5 |
import gradio as gr
|
|
|
28 |
"""
|
29 |
try:
|
30 |
api = HfApi(token=token)
|
31 |
+
is_private = api.model_info(repo_id=model_id).private
|
32 |
+
print("is_private", is_private)
|
33 |
|
34 |
commit_info = convert(api=api, model_id=model_id)
|
35 |
print("[commit_info]", commit_info)
|
|
|
37 |
# save in a (public) dataset:
|
38 |
if repo is not None and not is_private:
|
39 |
repo.git_pull(rebase=True)
|
40 |
+
print("pulled")
|
41 |
with open(DATA_FILE, "a") as csvfile:
|
42 |
writer = csv.DictWriter(
|
43 |
csvfile, fieldnames=["model_id", "pr_url", "time"]
|