capradeepgujaran commited on
Commit
ce9d36e
β€’
1 Parent(s): 16047d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
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-4o-mini", "gpt-4o"],
177
  label="Select Model",
178
- value="gpt-4o-mini"
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=[