marks
commited on
Commit
·
72e36b0
1
Parent(s):
0ebcd8e
Fixed Flask mismatch
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from flask import Flask
|
| 2 |
import gradio as gr
|
| 3 |
from scraper import scrape_url
|
| 4 |
from podcast_generator import PodcastGenerator
|
|
@@ -13,7 +13,8 @@ def generate_podcast(url):
|
|
| 13 |
audio_file = text_to_speech(podcast_text)
|
| 14 |
return audio_file
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
fn=generate_podcast,
|
| 18 |
inputs=gr.Textbox(
|
| 19 |
label="Website URL",
|
|
@@ -26,10 +27,12 @@ iface = gr.Interface(
|
|
| 26 |
allow_flagging="never",
|
| 27 |
)
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
if __name__ == "__main__":
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
share=True,
|
| 34 |
debug=True
|
| 35 |
)
|
|
|
|
| 1 |
+
from flask import Flask, render_template
|
| 2 |
import gradio as gr
|
| 3 |
from scraper import scrape_url
|
| 4 |
from podcast_generator import PodcastGenerator
|
|
|
|
| 13 |
audio_file = text_to_speech(podcast_text)
|
| 14 |
return audio_file
|
| 15 |
|
| 16 |
+
# Create Gradio interface
|
| 17 |
+
demo = gr.Interface(
|
| 18 |
fn=generate_podcast,
|
| 19 |
inputs=gr.Textbox(
|
| 20 |
label="Website URL",
|
|
|
|
| 27 |
allow_flagging="never",
|
| 28 |
)
|
| 29 |
|
| 30 |
+
# Mount Gradio interface to Flask
|
| 31 |
+
app = gr.mount_gradio_app(app, demo, path="/")
|
| 32 |
+
|
| 33 |
if __name__ == "__main__":
|
| 34 |
+
app.run(
|
| 35 |
+
host="0.0.0.0",
|
| 36 |
+
port=7860,
|
|
|
|
| 37 |
debug=True
|
| 38 |
)
|