Spaces:
Running
Running
Fix
Browse files
app.py
CHANGED
@@ -42,6 +42,11 @@ def validate_submission_inputs(**inputs):
|
|
42 |
def process_submission(*inputs):
|
43 |
try:
|
44 |
inputs = dict(zip(SUBMISSION_INPUTS, inputs))
|
|
|
|
|
|
|
|
|
|
|
45 |
validate_submission_inputs(**inputs)
|
46 |
metadata = SUBMISSION_INPUTS - {"submission_file"}
|
47 |
metadata = {key: inputs[key] for key in metadata}
|
@@ -229,15 +234,15 @@ with gr.Blocks(theme=gr.themes.Soft(text_size=text_md), css=custom_css) as main:
|
|
229 |
submission_inputs = dict.fromkeys(SUBMISSION_INPUTS)
|
230 |
|
231 |
with gr.Row():
|
232 |
-
submission_inputs["team_name"] = gr.Textbox(label='Team name')
|
233 |
-
submission_inputs["model_name"] = gr.Textbox(label='Model name')
|
234 |
submission_inputs["model_type"] = gr.Textbox(label='Model type')
|
235 |
submission_inputs["parameters"] = gr.Textbox(label='Parameters')
|
236 |
|
237 |
with gr.Row():
|
238 |
submission_inputs["precision"] = gr.Textbox(label='Precision')
|
239 |
-
submission_inputs["description"] = gr.Textbox(label='Description', type='text')
|
240 |
-
submission_inputs["link_to_model"] = gr.Textbox(label='Link to model', type='text')
|
241 |
|
242 |
submission_inputs["submission_file"] = gr.File(label='Upload your results', type='filepath')
|
243 |
|
|
|
42 |
def process_submission(*inputs):
|
43 |
try:
|
44 |
inputs = dict(zip(SUBMISSION_INPUTS, inputs))
|
45 |
+
for key in inputs:
|
46 |
+
if key in ("team_name", "model_name"):
|
47 |
+
inputs[key] = inputs[key].replace("\n", " ").strip()
|
48 |
+
elif key in ("description", "link_to_model"):
|
49 |
+
inputs[key] = inputs[key].strip() # TODO: u "link_to_model" kontrola funkčního URL
|
50 |
validate_submission_inputs(**inputs)
|
51 |
metadata = SUBMISSION_INPUTS - {"submission_file"}
|
52 |
metadata = {key: inputs[key] for key in metadata}
|
|
|
234 |
submission_inputs = dict.fromkeys(SUBMISSION_INPUTS)
|
235 |
|
236 |
with gr.Row():
|
237 |
+
submission_inputs["team_name"] = gr.Textbox(label='Team name')
|
238 |
+
submission_inputs["model_name"] = gr.Textbox(label='Model name')
|
239 |
submission_inputs["model_type"] = gr.Textbox(label='Model type')
|
240 |
submission_inputs["parameters"] = gr.Textbox(label='Parameters')
|
241 |
|
242 |
with gr.Row():
|
243 |
submission_inputs["precision"] = gr.Textbox(label='Precision')
|
244 |
+
submission_inputs["description"] = gr.Textbox(label='Description', type='text')
|
245 |
+
submission_inputs["link_to_model"] = gr.Textbox(label='Link to model', type='text')
|
246 |
|
247 |
submission_inputs["submission_file"] = gr.File(label='Upload your results', type='filepath')
|
248 |
|