Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,19 @@ x = st.slider('Select a value')
|
|
6 |
slider_reply = x, 'squared is', x * x
|
7 |
st.write(slider_reply)
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
prompt = st.chat_input("Say something")
|
11 |
if prompt:
|
|
|
6 |
slider_reply = x, 'squared is', x * x
|
7 |
st.write(slider_reply)
|
8 |
|
9 |
+
uploaded_file = st.file_uploader("Choose a file", "pdf")
|
10 |
+
if uploaded_file is not None:
|
11 |
+
for page_layout in extract_pages(uploaded_file):
|
12 |
+
for element in page_layout:
|
13 |
+
st.write(element)
|
14 |
+
with st.popover("Open popover"):
|
15 |
+
sound_file = BytesIO()
|
16 |
+
tts = gTTS(element, lang='en')
|
17 |
+
tts.write_to_fp(sound_file)
|
18 |
+
|
19 |
+
st.audio(sound_file)
|
20 |
+
|
21 |
+
|
22 |
|
23 |
prompt = st.chat_input("Say something")
|
24 |
if prompt:
|