Set braindao model type automatically
Browse files
app.py
CHANGED
@@ -171,7 +171,7 @@ with demo:
|
|
171 |
model_name_textbox = gr.Textbox(label="Model name")
|
172 |
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
173 |
model_type = gr.Dropdown(
|
174 |
-
choices=[t.to_str(" ") for t in ModelType if t
|
175 |
label="Model type",
|
176 |
multiselect=False,
|
177 |
value=None,
|
@@ -195,8 +195,14 @@ with demo:
|
|
195 |
|
196 |
submit_button = gr.Button("Submit")
|
197 |
submission_result = gr.Markdown()
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
submit_button.click(
|
199 |
-
|
200 |
[
|
201 |
model_name_textbox,
|
202 |
# base_model_name_textbox,
|
|
|
171 |
model_name_textbox = gr.Textbox(label="Model name")
|
172 |
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
173 |
model_type = gr.Dropdown(
|
174 |
+
choices=[t.to_str(" ") for t in ModelType if t in [ModelType.PT, ModelType.FT]],
|
175 |
label="Model type",
|
176 |
multiselect=False,
|
177 |
value=None,
|
|
|
195 |
|
196 |
submit_button = gr.Button("Submit")
|
197 |
submission_result = gr.Markdown()
|
198 |
+
|
199 |
+
def submit_with_braindao_check(model_name, revision, model_type):
|
200 |
+
if model_name.split("/")[0] == "braindao":
|
201 |
+
model_type = ModelType.BrainDAO.to_str(" ")
|
202 |
+
return add_new_eval(model_name, revision, model_type)
|
203 |
+
|
204 |
submit_button.click(
|
205 |
+
submit_with_braindao_check,
|
206 |
[
|
207 |
model_name_textbox,
|
208 |
# base_model_name_textbox,
|