Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,9 +50,17 @@ import gradio_client
|
|
50 |
import subprocess
|
51 |
import sys
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
external_log_dir = "./logs"
|
54 |
LOGDIR = external_log_dir
|
55 |
|
|
|
56 |
def install_gradio_4_35_0():
|
57 |
current_version = gr.__version__
|
58 |
if current_version != "4.35.0":
|
@@ -374,7 +382,22 @@ def bot(history):
|
|
374 |
}
|
375 |
print("#### conv log",data)
|
376 |
fout.write(json.dumps(data) + "\n")
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
|
379 |
|
380 |
txt = gr.Textbox(
|
|
|
50 |
import subprocess
|
51 |
import sys
|
52 |
|
53 |
+
from huggingface_hub import HfApi
|
54 |
+
from huggingface_hub import login
|
55 |
+
from huggingface_hub import revision_exists
|
56 |
+
|
57 |
+
api = HfApi()
|
58 |
+
repo_name = "paralym/pangea_logs"
|
59 |
+
|
60 |
external_log_dir = "./logs"
|
61 |
LOGDIR = external_log_dir
|
62 |
|
63 |
+
|
64 |
def install_gradio_4_35_0():
|
65 |
current_version = gr.__version__
|
66 |
if current_version != "4.35.0":
|
|
|
382 |
}
|
383 |
print("#### conv log",data)
|
384 |
fout.write(json.dumps(data) + "\n")
|
385 |
+
for upload_img in all_image_path:
|
386 |
+
api.upload_file(
|
387 |
+
path_or_fileobj=upload_img,
|
388 |
+
path_in_repo=upload_img.replace("./logs/"),
|
389 |
+
repo_id=repo_name,
|
390 |
+
repo_type="dataset",
|
391 |
+
# revision=revision,
|
392 |
+
# ignore_patterns=["data*"]
|
393 |
+
)
|
394 |
+
# upload json
|
395 |
+
api.upload_file(
|
396 |
+
path_or_fileobj=get_conv_log_filename(),
|
397 |
+
path_in_repo=get_conv_log_filename().replace("./logs/"),
|
398 |
+
repo_id=repo_name,
|
399 |
+
repo_type="dataset")
|
400 |
+
|
401 |
|
402 |
|
403 |
txt = gr.Textbox(
|