Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -81,8 +81,12 @@ def update_output(model_name: str, text: str, custom_token: str, selected_token:
|
|
81 |
|
82 |
return output, "", "", gr.update(choices=token_choices), predictions
|
83 |
|
84 |
-
|
|
|
|
|
|
|
85 |
gr.Markdown("# Interactive Text Generation")
|
|
|
86 |
|
87 |
with gr.Row():
|
88 |
model_dropdown = gr.Dropdown(
|
@@ -128,5 +132,5 @@ with gr.Blocks() as app:
|
|
128 |
outputs=[text_input, custom_token, token_dropdown, token_dropdown, predictions_output]
|
129 |
)
|
130 |
|
131 |
-
|
132 |
-
|
|
|
81 |
|
82 |
return output, "", "", gr.update(choices=token_choices), predictions
|
83 |
|
84 |
+
# Create the interface
|
85 |
+
demo = gr.Blocks(title="Interactive Text Generation")
|
86 |
+
|
87 |
+
with demo:
|
88 |
gr.Markdown("# Interactive Text Generation")
|
89 |
+
gr.Markdown("Generate text by selecting predicted tokens or writing your own.")
|
90 |
|
91 |
with gr.Row():
|
92 |
model_dropdown = gr.Dropdown(
|
|
|
132 |
outputs=[text_input, custom_token, token_dropdown, token_dropdown, predictions_output]
|
133 |
)
|
134 |
|
135 |
+
# For Hugging Face Spaces, we just need to expose the demo
|
136 |
+
demo.launch()
|