Ivan000 commited on
Commit
bdf7117
·
verified ·
1 Parent(s): 4d1489a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -25,14 +25,15 @@ def process_url(url):
25
  return audio_file, text
26
 
27
  # Create Gradio interface
28
- iface = gr.Interface(
29
- fn=process_url,
30
- inputs=gr.inputs.Textbox(lines=1, placeholder="Enter the URL of the webpage..."),
31
- outputs=[gr.outputs.Audio(type="filepath"), gr.outputs.Textbox(lines=10, label="Extracted Text")]
32
- )
 
33
 
34
  if __name__ == "__main__":
35
- iface.launch()
36
 
37
  # Dependencies
38
  # =============
 
25
  return audio_file, text
26
 
27
  # Create Gradio interface
28
+ with gr.Blocks() as demo:
29
+ url_input = gr.Textbox(lines=1, placeholder="Enter the URL of the webpage...")
30
+ audio_output = gr.Audio(label="Generated Speech")
31
+ text_output = gr.Textbox(lines=10, label="Extracted Text")
32
+ greet_btn = gr.Button("Submit")
33
+ greet_btn.click(fn=process_url, inputs=url_input, outputs=[audio_output, text_output])
34
 
35
  if __name__ == "__main__":
36
+ demo.launch()
37
 
38
  # Dependencies
39
  # =============