Spaces:
Runtime error
Runtime error
Qi Yan
commited on
Commit
·
35bea4b
1
Parent(s):
546a465
make sure student ID and csv are not empty
Browse files- app.py +1 -1
- src/submission/submit.py +6 -0
app.py
CHANGED
|
@@ -94,7 +94,7 @@ with demo:
|
|
| 94 |
gr.Markdown("## Submit Your Results")
|
| 95 |
|
| 96 |
with gr.Row():
|
| 97 |
-
student_id = gr.Textbox(label="Student ID")
|
| 98 |
model_name = gr.Textbox(label="Model Name", value='pixelCNN++')
|
| 99 |
csv_upload = gr.UploadButton(
|
| 100 |
label="Upload Predictions CSV",
|
|
|
|
| 94 |
gr.Markdown("## Submit Your Results")
|
| 95 |
|
| 96 |
with gr.Row():
|
| 97 |
+
student_id = gr.Textbox(label="Student ID", value='455')
|
| 98 |
model_name = gr.Textbox(label="Model Name", value='pixelCNN++')
|
| 99 |
csv_upload = gr.UploadButton(
|
| 100 |
label="Upload Predictions CSV",
|
src/submission/submit.py
CHANGED
|
@@ -80,6 +80,12 @@ def process_submission(
|
|
| 80 |
|
| 81 |
submitted_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
# Seems good, creating the eval
|
| 84 |
print("Adding new eval request")
|
| 85 |
|
|
|
|
| 80 |
|
| 81 |
submitted_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
| 82 |
|
| 83 |
+
if not student_id.strip():
|
| 84 |
+
return styled_error("Submission failed! Student ID cannot be empty!")
|
| 85 |
+
|
| 86 |
+
if csv_upload is None:
|
| 87 |
+
return styled_error("Submission failed! CSV file cannot be empty!")
|
| 88 |
+
|
| 89 |
# Seems good, creating the eval
|
| 90 |
print("Adding new eval request")
|
| 91 |
|