Spaces:
Running
Running
Adding default values.
Browse files
app.py
CHANGED
|
@@ -180,55 +180,55 @@ def add_new_eval(
|
|
| 180 |
|
| 181 |
|
| 182 |
with gr.Blocks() as demo:
|
| 183 |
-
gr.Markdown("This is a super basic example 'frontend'. Fill out below then click **Run** to create the request file and launch the job.")
|
| 184 |
-
gr.Markdown("The request file will be written so %s." % REQUESTS_DATASET_PATH)
|
| 185 |
-
gr.Markdown("The job will be launched at [EnergyStarAI/launch-computation-example](https://huggingface.co/spaces/EnergyStarAI/launch-computation-example).")
|
| 186 |
with gr.Row():
|
| 187 |
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
|
| 234 |
demo.launch()
|
|
|
|
| 180 |
|
| 181 |
|
| 182 |
with gr.Blocks() as demo:
|
| 183 |
+
gr.Markdown("# This is a super basic example 'frontend'. Fill out below then click **Run** to create the request file and launch the job.")
|
| 184 |
+
gr.Markdown("## The request file will be written so %s." % REQUESTS_DATASET_PATH)
|
| 185 |
+
gr.Markdown("## The job will be launched at [EnergyStarAI/launch-computation-example](https://huggingface.co/spaces/EnergyStarAI/launch-computation-example).")
|
| 186 |
with gr.Row():
|
| 187 |
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
| 188 |
+
with gr.Row():
|
| 189 |
+
with gr.Column():
|
| 190 |
+
model_name_textbox = gr.Textbox(label="Model name", placeholder="lvwerra/distilbert-imdb")
|
| 191 |
+
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
| 192 |
+
model_type = gr.Dropdown(
|
| 193 |
+
choices=[t.to_str(" : ") for t in ModelType if t != ModelType.Unknown],
|
| 194 |
+
label="Model type",
|
| 195 |
+
placeholder="pretrained"
|
| 196 |
+
multiselect=False,
|
| 197 |
+
value=None,
|
| 198 |
+
interactive=True,
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
with gr.Column():
|
| 202 |
+
precision = gr.Dropdown(
|
| 203 |
+
choices=[i.value.name for i in Precision if i != Precision.Unknown],
|
| 204 |
+
label="Precision",
|
| 205 |
+
multiselect=False,
|
| 206 |
+
value="float16",
|
| 207 |
+
interactive=True,
|
| 208 |
+
)
|
| 209 |
+
weight_type = gr.Dropdown(
|
| 210 |
+
choices=[i.value.name for i in WeightType],
|
| 211 |
+
label="Weights type",
|
| 212 |
+
multiselect=False,
|
| 213 |
+
value="Original",
|
| 214 |
+
interactive=True,
|
| 215 |
+
)
|
| 216 |
+
|
| 217 |
+
with gr.Row():
|
| 218 |
+
with gr.Column():
|
| 219 |
+
submit_button = gr.Button("Run Analysis")
|
| 220 |
+
submission_result = gr.Markdown()
|
| 221 |
+
submit_button.click(
|
| 222 |
+
fn=add_new_eval,
|
| 223 |
+
inputs=[
|
| 224 |
+
model_name_textbox,
|
| 225 |
+
"",
|
| 226 |
+
revision_name_textbox,
|
| 227 |
+
precision,
|
| 228 |
+
weight_type,
|
| 229 |
+
model_type,
|
| 230 |
+
],
|
| 231 |
+
outputs=submission_result,
|
| 232 |
+
)
|
| 233 |
|
| 234 |
demo.launch()
|