Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ from search import search
|
|
9 |
from get_paper import get_paper
|
10 |
from get_pages import get_pages
|
11 |
from tts import tts
|
|
|
12 |
|
13 |
|
14 |
st.title("ArXiV Audio")
|
@@ -46,15 +47,15 @@ if paper:
|
|
46 |
print("total pages=", tpages)
|
47 |
pgs = [i+1 for i in range(tpages)]
|
48 |
|
49 |
-
start_page =
|
50 |
-
end_page =
|
51 |
|
52 |
with st.form(key = "page_form"):
|
53 |
col1, col2 = st.columns(2)
|
54 |
with col1:
|
55 |
-
|
56 |
with col2:
|
57 |
-
|
58 |
submit_pages = st.form_submit_button(label = "Convert To Audio")
|
59 |
|
60 |
if submit_pages:
|
@@ -64,5 +65,6 @@ if paper:
|
|
64 |
content = get_pages(name, start_page, end_page)
|
65 |
|
66 |
wav, rate = tts(content)
|
|
|
67 |
|
68 |
|
|
|
9 |
from get_paper import get_paper
|
10 |
from get_pages import get_pages
|
11 |
from tts import tts
|
12 |
+
import IPython.display as ipd
|
13 |
|
14 |
|
15 |
st.title("ArXiV Audio")
|
|
|
47 |
print("total pages=", tpages)
|
48 |
pgs = [i+1 for i in range(tpages)]
|
49 |
|
50 |
+
start_page = 1
|
51 |
+
end_page = 1
|
52 |
|
53 |
with st.form(key = "page_form"):
|
54 |
col1, col2 = st.columns(2)
|
55 |
with col1:
|
56 |
+
s_page = st.selectbox(label = "Start Page", options = pgs)
|
57 |
with col2:
|
58 |
+
e_page = st.selectbox(label = "End Page", options = pgs, index = pgs[-1]-1)
|
59 |
submit_pages = st.form_submit_button(label = "Convert To Audio")
|
60 |
|
61 |
if submit_pages:
|
|
|
65 |
content = get_pages(name, start_page, end_page)
|
66 |
|
67 |
wav, rate = tts(content)
|
68 |
+
ipd.Audio(wav, rate=rate)
|
69 |
|
70 |
|