Spaces:
Runtime error
Runtime error
:sparkels: add button to facilitate returning to model card.
Browse files
app.py
CHANGED
@@ -115,13 +115,22 @@ with gr.Blocks(title_text, css=css) as demo:
|
|
115 |
""")
|
116 |
|
117 |
# hidden_state = gr.State(value=initial_model)
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
gr.ChatInterface(
|
127 |
respond,
|
|
|
115 |
""")
|
116 |
|
117 |
# hidden_state = gr.State(value=initial_model)
|
118 |
+
with gr.Row():
|
119 |
+
model_selector = gr.Dropdown(
|
120 |
+
label="Select your Model",
|
121 |
+
choices=build_model_choices(),
|
122 |
+
value=initial_model,
|
123 |
+
# value=hidden_state,
|
124 |
+
scale=4
|
125 |
+
)
|
126 |
+
gr.Button(
|
127 |
+
value="Visit Model Card ↗️",
|
128 |
+
scale=1
|
129 |
+
).click(
|
130 |
+
inputs=[model_selector],
|
131 |
+
js="(model_selection) => { window.open(`https://huggingface.co/${model_selection}`, '_blank') }",
|
132 |
+
fn=None,
|
133 |
+
)
|
134 |
|
135 |
gr.ChatInterface(
|
136 |
respond,
|