Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -128,21 +128,20 @@ def app():
|
|
128 |
label="Voice Quality"
|
129 |
)
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
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
|
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():
|