Weyaxi commited on
Commit
fd99fed
·
verified ·
1 Parent(s): 5f9d5db

temp solutioın

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -61,12 +61,16 @@ with gr.Blocks() as demo:
61
  with gr.Column():
62
  output = gr.Textbox(label="Output", lines=1)
63
  gr.LogoutButton()
64
-
65
- if "mattshumer" in model_id:
66
- gr.Error("DON'T, DON'T SPAM THAT MODELS")
67
 
68
- submit_btn = gr.Button("Submit", variant="primary")
69
- submit_btn.click(commit, model_id, output)
 
 
 
 
 
 
 
70
 
71
  threading.Thread(target=refresh).start()
72
  demo.launch()
 
61
  with gr.Column():
62
  output = gr.Textbox(label="Output", lines=1)
63
  gr.LogoutButton()
 
 
 
64
 
65
+ submit_btn = gr.Button("Submit", variant="primary")
66
+
67
+ def validate_model_id(input_id):
68
+ if "mattshumer" in input_id:
69
+ return "DON'T, DON'T SPAM THAT MODELS"
70
+ else:
71
+ return commit(input_id)
72
+
73
+ submit_btn.click(validate_model_id, model_id, output)
74
 
75
  threading.Thread(target=refresh).start()
76
  demo.launch()