yabramuvdi commited on
Commit
0c7c094
·
verified ·
1 Parent(s): dcae79c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- with gr.Blocks() as app:
 
 
 
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
- if __name__ == "__main__":
132
- app.launch(share=True)
 
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()