Clear outputs, change placeholder.
Browse files
app.py
CHANGED
@@ -283,8 +283,7 @@ with gr.Blocks() as demo:
|
|
283 |
input_model = gr.Textbox(
|
284 |
max_lines=1,
|
285 |
label="Model name or URL, such as apple/mobilevit-small",
|
286 |
-
placeholder="distilbert-base-uncased",
|
287 |
-
value="distilbert-base-uncased",
|
288 |
)
|
289 |
btn_get_tasks = gr.Button("Load")
|
290 |
with gr.Column(scale=3):
|
@@ -330,6 +329,18 @@ with gr.Blocks() as demo:
|
|
330 |
|
331 |
error_output = gr.Markdown(label="Output")
|
332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
btn_get_tasks.click(
|
334 |
fn=on_model_change,
|
335 |
inputs=input_model,
|
|
|
283 |
input_model = gr.Textbox(
|
284 |
max_lines=1,
|
285 |
label="Model name or URL, such as apple/mobilevit-small",
|
286 |
+
placeholder="pcuenq/distilbert-base-uncased",
|
|
|
287 |
)
|
288 |
btn_get_tasks = gr.Button("Load")
|
289 |
with gr.Column(scale=3):
|
|
|
329 |
|
330 |
error_output = gr.Markdown(label="Output")
|
331 |
|
332 |
+
# Clear output
|
333 |
+
btn_get_tasks.click(lambda x: gr.update(value=''), [], [error_output])
|
334 |
+
btn_convert.click(lambda x: gr.update(value=''), [], [error_output])
|
335 |
+
input_model.submit(lambda x: gr.update(value=''), [],[error_output])
|
336 |
+
|
337 |
+
input_model.submit(
|
338 |
+
fn=on_model_change,
|
339 |
+
inputs=input_model,
|
340 |
+
outputs=[group_settings, radio_tasks, radio_framework, error_output],
|
341 |
+
queue=False,
|
342 |
+
scroll_to_output=True
|
343 |
+
)
|
344 |
btn_get_tasks.click(
|
345 |
fn=on_model_change,
|
346 |
inputs=input_model,
|