Spaces:
Sleeping
Sleeping
Brian Watson
commited on
Commit
·
b965088
1
Parent(s):
0eac613
Update app.py
Browse files
app.py
CHANGED
@@ -26,9 +26,9 @@ def text_it(inputs, text_gen=text_gen):
|
|
26 |
return text_gen(inputs)
|
27 |
|
28 |
|
29 |
-
def set_model(
|
30 |
global current_model
|
31 |
-
current_model = models[
|
32 |
return gr.update(label=f"{current_model['name']}")
|
33 |
|
34 |
|
@@ -67,7 +67,7 @@ with gr.Blocks(css=css) as myface:
|
|
67 |
model_name1 = gr.Dropdown(
|
68 |
label="Choose Model",
|
69 |
choices=[m["name"] for m in models],
|
70 |
-
type="
|
71 |
value=current_model["name"],
|
72 |
interactive=True,
|
73 |
)
|
@@ -118,4 +118,4 @@ with gr.Blocks(css=css) as myface:
|
|
118 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
119 |
|
120 |
myface.queue(concurrency_count=200)
|
121 |
-
myface.launch(inline=True, show_api=False, max_threads=400)
|
|
|
26 |
return text_gen(inputs)
|
27 |
|
28 |
|
29 |
+
def set_model(current_model_name):
|
30 |
global current_model
|
31 |
+
current_model = next((m for m in models if m["name"] == current_model_name), None)
|
32 |
return gr.update(label=f"{current_model['name']}")
|
33 |
|
34 |
|
|
|
67 |
model_name1 = gr.Dropdown(
|
68 |
label="Choose Model",
|
69 |
choices=[m["name"] for m in models],
|
70 |
+
type="auto_complete",
|
71 |
value=current_model["name"],
|
72 |
interactive=True,
|
73 |
)
|
|
|
118 |
see_prompts.click(text_it, inputs=[input_text], outputs=[magic8])
|
119 |
|
120 |
myface.queue(concurrency_count=200)
|
121 |
+
myface.launch(inline=True, show_api=False, max_threads=400)
|