Spaces:
Sleeping
Sleeping
capradeepgujaran
commited on
Commit
β’
ce9d36e
1
Parent(s):
16047d7
Update app.py
Browse files
app.py
CHANGED
@@ -173,16 +173,16 @@ def create_gradio_interface():
|
|
173 |
with gr.Tab("β Ask a Question"):
|
174 |
query_input = gr.Textbox(label="Enter your question")
|
175 |
model_dropdown = gr.Dropdown(
|
176 |
-
choices=["gpt-
|
177 |
label="Select Model",
|
178 |
-
value="gpt-
|
179 |
)
|
180 |
similarity_checkbox = gr.Checkbox(label="Use Similarity Check", value=False)
|
181 |
query_button = gr.Button("Ask")
|
182 |
answer_output = gr.Textbox(label="Answer", interactive=False)
|
183 |
|
184 |
with gr.Tab("π£οΈ Generate Audio and Text"):
|
185 |
-
text_input = gr.Textbox(label="Enter text for generation")
|
186 |
voice_type = gr.Dropdown(
|
187 |
choices=["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
|
188 |
label="Voice Type",
|
@@ -229,6 +229,13 @@ def create_gradio_interface():
|
|
229 |
outputs=[answer_output]
|
230 |
)
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
generate_button.click(
|
233 |
fn=generate_audio_and_text,
|
234 |
inputs=[
|
|
|
173 |
with gr.Tab("β Ask a Question"):
|
174 |
query_input = gr.Textbox(label="Enter your question")
|
175 |
model_dropdown = gr.Dropdown(
|
176 |
+
choices=["gpt-4-0125-preview", "gpt-3.5-turbo-0125"],
|
177 |
label="Select Model",
|
178 |
+
value="gpt-3.5-turbo-0125"
|
179 |
)
|
180 |
similarity_checkbox = gr.Checkbox(label="Use Similarity Check", value=False)
|
181 |
query_button = gr.Button("Ask")
|
182 |
answer_output = gr.Textbox(label="Answer", interactive=False)
|
183 |
|
184 |
with gr.Tab("π£οΈ Generate Audio and Text"):
|
185 |
+
text_input = gr.Textbox(label="Enter text for generation") # This is the target input for the generated answer
|
186 |
voice_type = gr.Dropdown(
|
187 |
choices=["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
|
188 |
label="Voice Type",
|
|
|
229 |
outputs=[answer_output]
|
230 |
)
|
231 |
|
232 |
+
# Automatically paste the answer into the "Enter text for generation" text box
|
233 |
+
answer_output.change(
|
234 |
+
fn=lambda ans: ans, # This function will pass the answer to the text_input for generation
|
235 |
+
inputs=[answer_output],
|
236 |
+
outputs=[text_input]
|
237 |
+
)
|
238 |
+
|
239 |
generate_button.click(
|
240 |
fn=generate_audio_and_text,
|
241 |
inputs=[
|