idolezal commited on
Commit
6d1eaa5
β€’
1 Parent(s): 66ea54e

More specific types of submission inputs

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -41,6 +41,8 @@ def validate_submission_inputs(**inputs):
41
  raise ValueError('File does not exist')
42
  if not (inputs["link_to_model"].startswith("http://") or inputs["link_to_model"].startswith("https://")):
43
  raise ValueError('Link does not starts with "http://" or "https://"')
 
 
44
 
45
  def process_submission(*inputs):
46
  try:
@@ -237,13 +239,19 @@ with gr.Blocks(theme=gr.themes.Soft(text_size=text_md), css=custom_css) as main:
237
  submission_inputs = dict.fromkeys(SUBMISSION_INPUTS)
238
 
239
  with gr.Row():
240
- submission_inputs["team_name"] = gr.Textbox(label='Team name')
241
- submission_inputs["model_name"] = gr.Textbox(label='Model name')
242
- submission_inputs["model_type"] = gr.Textbox(label='Model type')
243
- submission_inputs["parameters"] = gr.Textbox(label='Parameters')
 
 
 
244
 
245
  with gr.Row():
246
- submission_inputs["precision"] = gr.Textbox(label='Precision')
 
 
 
247
  submission_inputs["description"] = gr.Textbox(label='Description', type='text')
248
  submission_inputs["link_to_model"] = gr.Textbox(label='Link to model', type='text')
249
 
 
41
  raise ValueError('File does not exist')
42
  if not (inputs["link_to_model"].startswith("http://") or inputs["link_to_model"].startswith("https://")):
43
  raise ValueError('Link does not starts with "http://" or "https://"')
44
+ if not inputs["parameters"] > 0:
45
+ raise ValueError('Attribute `Parameters (B)` should be greater than zero')
46
 
47
  def process_submission(*inputs):
48
  try:
 
239
  submission_inputs = dict.fromkeys(SUBMISSION_INPUTS)
240
 
241
  with gr.Row():
242
+ submission_inputs["team_name"] = gr.Textbox(label='Team name', type='text')
243
+ submission_inputs["model_name"] = gr.Textbox(label='Model name', type='text')
244
+ submission_inputs["model_type"] = gr.Dropdown(
245
+ label="Model type",
246
+ choices=("chat", "pretrained", "ensamble"),
247
+ )
248
+ submission_inputs["parameters"] = gr.Number(label='Parameters (B)')
249
 
250
  with gr.Row():
251
+ submission_inputs["precision"] = gr.Dropdown(
252
+ label="Precision",
253
+ choices=("float32", "bfloat32", "float16", "bfloat16", "8bit", "4bit"),
254
+ )
255
  submission_inputs["description"] = gr.Textbox(label='Description', type='text')
256
  submission_inputs["link_to_model"] = gr.Textbox(label='Link to model', type='text')
257