Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,6 @@ def display_user_data(user_id):
|
|
| 96 |
return "User not found"
|
| 97 |
|
| 98 |
demo = gr.Blocks(css=custom_css)
|
| 99 |
-
|
| 100 |
with demo:
|
| 101 |
gr.HTML(TITLE)
|
| 102 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
|
@@ -133,64 +132,60 @@ with demo:
|
|
| 133 |
datatype=EVAL_TYPES,
|
| 134 |
row_count=5,
|
| 135 |
)
|
| 136 |
-
with gr.Row():
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
start_button = gr.Button("Start", elem_id="start_button")
|
| 193 |
-
scheduler = BackgroundScheduler()
|
| 194 |
-
scheduler.add_job(restart_space, "interval", seconds=1800)
|
| 195 |
-
scheduler.start()
|
| 196 |
demo.queue(default_concurrency_limit=40).launch()
|
|
|
|
| 96 |
return "User not found"
|
| 97 |
|
| 98 |
demo = gr.Blocks(css=custom_css)
|
|
|
|
| 99 |
with demo:
|
| 100 |
gr.HTML(TITLE)
|
| 101 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
|
|
|
| 132 |
datatype=EVAL_TYPES,
|
| 133 |
row_count=5,
|
| 134 |
)
|
| 135 |
+
with gr.Row():
|
| 136 |
+
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
| 137 |
+
with gr.Row():
|
| 138 |
+
with gr.Column():
|
| 139 |
+
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
| 140 |
+
model_type = gr.Dropdown(
|
| 141 |
+
choices=[t.to_str(" : ") for t in ModelType if t.value != ModelType.Unknown.value],
|
| 142 |
+
label="Model type",
|
| 143 |
+
multiselect=False,
|
| 144 |
+
value=None,
|
| 145 |
+
interactive=True,
|
| 146 |
+
)
|
| 147 |
+
with gr.Column():
|
| 148 |
+
precision = gr.Dropdown(
|
| 149 |
+
choices=[i.value.name for i in Precision if i.value != Precision.Unknown.value],
|
| 150 |
+
label="Precision",
|
| 151 |
+
multiselect=False,
|
| 152 |
+
value="float16",
|
| 153 |
+
interactive=True,
|
| 154 |
+
)
|
| 155 |
+
weight_type = gr.Dropdown(
|
| 156 |
+
choices=[i.value.name for i in WeightType],
|
| 157 |
+
label="Weights type",
|
| 158 |
+
multiselect=False,
|
| 159 |
+
value="Original",
|
| 160 |
+
interactive=True,
|
| 161 |
+
)
|
| 162 |
+
base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
| 163 |
+
model_name_textbox = gr.Textbox(label="Model name") # Add this line
|
| 164 |
+
submit_button = gr.Button("Submit Eval")
|
| 165 |
+
submission_result = gr.Markdown()
|
| 166 |
+
with gr.Row():
|
| 167 |
+
with gr.Accordion("📙 Citation", open=False):
|
| 168 |
+
citation_button = gr.Textbox(
|
| 169 |
+
value=CITATION_BUTTON_TEXT,
|
| 170 |
+
label=CITATION_BUTTON_LABEL,
|
| 171 |
+
lines=20,
|
| 172 |
+
elem_id="citation-button",
|
| 173 |
+
show_copy_button=True,
|
| 174 |
+
)
|
| 175 |
+
submit_button.click(
|
| 176 |
+
add_new_eval,
|
| 177 |
+
[
|
| 178 |
+
model_name_textbox,
|
| 179 |
+
base_model_name_textbox,
|
| 180 |
+
revision_name_textbox,
|
| 181 |
+
precision,
|
| 182 |
+
weight_type,
|
| 183 |
+
model_type,
|
| 184 |
+
],
|
| 185 |
+
submission_result,
|
| 186 |
+
)
|
| 187 |
+
start_button = gr.Button("Start", elem_id="start_button")
|
| 188 |
+
scheduler = BackgroundScheduler()
|
| 189 |
+
scheduler.add_job(restart_space, "interval", seconds=1800)
|
| 190 |
+
scheduler.start()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
demo.queue(default_concurrency_limit=40).launch()
|