Spaces:
Sleeping
Sleeping
added "set error message" function
Browse files
app.py
CHANGED
|
@@ -22,6 +22,8 @@ import requests
|
|
| 22 |
import matplotlib
|
| 23 |
matplotlib.use("Agg")
|
| 24 |
|
|
|
|
|
|
|
| 25 |
def fetch_required_files(exp_config):
|
| 26 |
# os.makedirs("temp_data", exist_ok=True)
|
| 27 |
for key in exp_config:
|
|
@@ -116,15 +118,19 @@ local_file_path = hf_hub_download(repo_id="IndoorOutdoor/metadata",
|
|
| 116 |
REPO_ID = f"{OWNER}/leaderboard"
|
| 117 |
QUEUE_REPO = f"{OWNER}/requests"
|
| 118 |
RESULTS_REPO = f"{OWNER}/results"
|
|
|
|
|
|
|
| 119 |
global_error_message = "Ready for submission!"
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
|
| 125 |
def get_error_message():
|
| 126 |
return global_error_message
|
| 127 |
|
|
|
|
|
|
|
| 128 |
def install_requirements(file_path):
|
| 129 |
try:
|
| 130 |
with open(file_path, "r") as file:
|
|
@@ -486,7 +492,7 @@ with gr.Blocks() as demo:
|
|
| 486 |
gr.Markdown("# 🚀 Model Submission & Leaderboard (Hugging Face Spaces)")
|
| 487 |
|
| 488 |
with gr.Row():
|
| 489 |
-
username_input = gr.Textbox(label="
|
| 490 |
file_input = gr.File(label="Upload Zip File")
|
| 491 |
submit_button = gr.Button("Submit File")
|
| 492 |
|
|
|
|
| 22 |
import matplotlib
|
| 23 |
matplotlib.use("Agg")
|
| 24 |
|
| 25 |
+
# The variable "username" actually refers to "model name"
|
| 26 |
+
|
| 27 |
def fetch_required_files(exp_config):
|
| 28 |
# os.makedirs("temp_data", exist_ok=True)
|
| 29 |
for key in exp_config:
|
|
|
|
| 118 |
REPO_ID = f"{OWNER}/leaderboard"
|
| 119 |
QUEUE_REPO = f"{OWNER}/requests"
|
| 120 |
RESULTS_REPO = f"{OWNER}/results"
|
| 121 |
+
|
| 122 |
+
|
| 123 |
global_error_message = "Ready for submission!"
|
| 124 |
+
def set_error_message(message):
|
| 125 |
+
global global_error_message
|
| 126 |
+
global_error_message = message
|
| 127 |
+
print("ERROR UPDATED:", global_error_message) # Debugging
|
| 128 |
|
| 129 |
def get_error_message():
|
| 130 |
return global_error_message
|
| 131 |
|
| 132 |
+
|
| 133 |
+
|
| 134 |
def install_requirements(file_path):
|
| 135 |
try:
|
| 136 |
with open(file_path, "r") as file:
|
|
|
|
| 492 |
gr.Markdown("# 🚀 Model Submission & Leaderboard (Hugging Face Spaces)")
|
| 493 |
|
| 494 |
with gr.Row():
|
| 495 |
+
username_input = gr.Textbox(label="Model Name")
|
| 496 |
file_input = gr.File(label="Upload Zip File")
|
| 497 |
submit_button = gr.Button("Submit File")
|
| 498 |
|