PuristanLabs1 commited on
Commit
222c2e0
·
verified ·
1 Parent(s): ef26fae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -128,21 +128,20 @@ def app():
128
  label="Voice Quality"
129
  )
130
 
131
- with gr.Row():
132
- text_input = gr.Textbox(
133
- label="Enter Text",
134
- placeholder="Type your text here...",
135
- lines=5
136
- )
137
 
138
  # Add sample input buttons
139
  with gr.Row():
140
  for sample in sample_inputs:
141
- gr.Button(value=sample).click(
142
- fn=lambda s: s,
143
- inputs=[],
144
- outputs=text_input,
145
- _js=f"(function(){{ return '{sample}' }})()" # JavaScript to update the textbox
146
  )
147
 
148
  with gr.Row():
 
128
  label="Voice Quality"
129
  )
130
 
131
+ # Textbox for text input
132
+ text_input = gr.Textbox(
133
+ label="Enter Text",
134
+ placeholder="Type your text here...",
135
+ lines=5
136
+ )
137
 
138
  # Add sample input buttons
139
  with gr.Row():
140
  for sample in sample_inputs:
141
+ gr.Button(value=f"Use Sample: {sample}").click(
142
+ fn=lambda x: x, # Return the sample text
143
+ inputs=[gr.Textbox(value=sample, visible=False)], # Pass sample as input
144
+ outputs=text_input # Update the text input
 
145
  )
146
 
147
  with gr.Row():