Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,13 @@ model_dropdown = gr.inputs.Dropdown(models, label="Select Model")
|
|
| 25 |
input_text = gr.inputs.Textbox(lines=5, label="Input Text")
|
| 26 |
output_text = gr.outputs.Textbox(label="Output Text")
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
interface.launch()
|
|
|
|
| 25 |
input_text = gr.inputs.Textbox(lines=5, label="Input Text")
|
| 26 |
output_text = gr.outputs.Textbox(label="Output Text")
|
| 27 |
|
| 28 |
+
def change_model(model_name):
|
| 29 |
+
global interface
|
| 30 |
+
interface.close()
|
| 31 |
+
interface = gr.Interface(generate_text, inputs=[model_name, input_text], outputs=output_text)
|
| 32 |
+
interface.launch()
|
| 33 |
|
| 34 |
+
interface = gr.Interface(generate_text, inputs=[model_dropdown, input_text], outputs=output_text, capture_session=True)
|
| 35 |
+
|
| 36 |
+
change_model_button = gr.Interface.load("models/stabilityai/stable-diffusion-2", capture_session=True).launch()
|
| 37 |
interface.launch()
|