kunato commited on
Commit
edfe6ac
1 Parent(s): 4fe5674

update label / error msg

Browse files
Files changed (2) hide show
  1. src/pages/submit.py +1 -1
  2. src/submission/submit.py +3 -1
src/pages/submit.py CHANGED
@@ -43,7 +43,7 @@ def show_submit_page(index: int):
43
  with gr.Row():
44
  with gr.Column():
45
  model_name_textbox = gr.Textbox(label="Huggingface Model")
46
- link_to_model_blog = gr.Textbox(label="Model release blog / Technical report")
47
 
48
  submit_button = gr.Button("Submit Model")
49
  submission_result = gr.Markdown()
 
43
  with gr.Row():
44
  with gr.Column():
45
  model_name_textbox = gr.Textbox(label="Huggingface Model")
46
+ link_to_model_blog = gr.Textbox(label="Link to model release blog / technical report")
47
 
48
  submit_button = gr.Button("Submit Model")
49
  submission_result = gr.Markdown()
src/submission/submit.py CHANGED
@@ -24,13 +24,15 @@ def add_new_eval(
24
 
25
  user_name = ""
26
  model_path = model
 
 
 
27
  if "/" in model:
28
  user_name = model.split("/")[0]
29
  model_path = model.split("/")[1]
30
 
31
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
32
 
33
-
34
  revision = "main"
35
 
36
  # Is the model info correctly filled?
 
24
 
25
  user_name = ""
26
  model_path = model
27
+ if model_path.startswith('https:'):
28
+ return styled_error("Huggingface model should be referred to by its name, not by its URL")
29
+
30
  if "/" in model:
31
  user_name = model.split("/")[0]
32
  model_path = model.split("/")[1]
33
 
34
  current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
35
 
 
36
  revision = "main"
37
 
38
  # Is the model info correctly filled?