Spaces:
Sleeping
Sleeping
Sealical
commited on
Commit
Β·
9f5d67a
1
Parent(s):
0c53877
update space
Browse files
app.py
CHANGED
@@ -75,7 +75,7 @@ SUBMISSION_TEXT = """
|
|
75 |
βββ evaluation_results/ # Directory containing all result files
|
76 |
βββ PhysCodeEval_results.json # Main evaluation results file
|
77 |
```
|
78 |
-
5.
|
79 |
|
80 |
Your submission will be verified and added to the leaderboard once approved.
|
81 |
"""
|
@@ -366,20 +366,9 @@ def create_demo():
|
|
366 |
with gr.TabItem("π Submit", id=3):
|
367 |
gr.Markdown(SUBMISSION_TEXT, elem_classes="markdown-text")
|
368 |
|
369 |
-
gr.Markdown("###
|
370 |
with gr.Row():
|
371 |
-
zip_file_input = gr.File(label="Upload submission ZIP file")
|
372 |
-
|
373 |
-
zip_submit_button = gr.Button("Submit ZIP File")
|
374 |
-
zip_submission_result = gr.Markdown()
|
375 |
-
|
376 |
-
zip_submit_button.click(
|
377 |
-
process_zip_submission,
|
378 |
-
[zip_file_input],
|
379 |
-
zip_submission_result,
|
380 |
-
)
|
381 |
-
|
382 |
-
gr.Markdown("### Option 2: Submit Form")
|
383 |
with gr.Row():
|
384 |
with gr.Column():
|
385 |
model_name_input = gr.Textbox(label="Model Name*")
|
@@ -395,13 +384,29 @@ def create_demo():
|
|
395 |
email_input = gr.Textbox(label="Contact Email*")
|
396 |
submission_link_input = gr.Textbox(label="GitHub Pull Request URL")
|
397 |
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
[model_name_input, model_type_input, organization_input, team_name_input, email_input, submission_link_input],
|
404 |
-
|
405 |
)
|
406 |
|
407 |
with gr.Row():
|
|
|
75 |
βββ evaluation_results/ # Directory containing all result files
|
76 |
βββ PhysCodeEval_results.json # Main evaluation results file
|
77 |
```
|
78 |
+
5. Zip your submission folder and upload it below along with your model details
|
79 |
|
80 |
Your submission will be verified and added to the leaderboard once approved.
|
81 |
"""
|
|
|
366 |
with gr.TabItem("π Submit", id=3):
|
367 |
gr.Markdown(SUBMISSION_TEXT, elem_classes="markdown-text")
|
368 |
|
369 |
+
gr.Markdown("### Submission Details")
|
370 |
with gr.Row():
|
371 |
+
zip_file_input = gr.File(label="Upload submission ZIP file*")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
with gr.Row():
|
373 |
with gr.Column():
|
374 |
model_name_input = gr.Textbox(label="Model Name*")
|
|
|
384 |
email_input = gr.Textbox(label="Contact Email*")
|
385 |
submission_link_input = gr.Textbox(label="GitHub Pull Request URL")
|
386 |
|
387 |
+
submit_button = gr.Button("Submit")
|
388 |
+
submission_result = gr.Markdown()
|
389 |
+
|
390 |
+
# Combined submission function that processes both ZIP and form data
|
391 |
+
def combined_submission(zip_file, model_name, model_type, organization, team_name, email, submission_link):
|
392 |
+
if zip_file is None:
|
393 |
+
return "Error: Please upload a ZIP file containing your submission."
|
394 |
+
|
395 |
+
if not model_name or not model_type or not email:
|
396 |
+
return "Error: Model name, model type, and email are required fields."
|
397 |
+
|
398 |
+
# Process ZIP file
|
399 |
+
zip_result = process_zip_submission(zip_file)
|
400 |
+
if zip_result.startswith("Error:"):
|
401 |
+
return zip_result
|
402 |
+
|
403 |
+
# Process form data
|
404 |
+
return f"Thank you for submitting {model_name} from {organization or team_name}! Your submission ZIP has been processed successfully. We will contact you at {email} if we need additional information."
|
405 |
|
406 |
+
submit_button.click(
|
407 |
+
combined_submission,
|
408 |
+
[zip_file_input, model_name_input, model_type_input, organization_input, team_name_input, email_input, submission_link_input],
|
409 |
+
submission_result,
|
410 |
)
|
411 |
|
412 |
with gr.Row():
|