Update app.py
Browse files
app.py
CHANGED
@@ -268,17 +268,17 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
268 |
pdf_page_to_image('/home/user/app/pdf2image/output.pdf', page_number, '/home/user/app/pdf2image/output.png')
|
269 |
|
270 |
image = Image.open('/home/user/app/pdf2image/output.png')
|
271 |
-
|
272 |
st.session_state.image_displayed = True
|
273 |
-
return image
|
274 |
|
275 |
def generate_audio():
|
276 |
sound_file = BytesIO()
|
277 |
tts = gTTS(result['result'], lang='en')
|
278 |
tts.write_to_fp(sound_file)
|
279 |
-
|
280 |
st.session_state.sound_played = True
|
281 |
-
return sound_file
|
282 |
|
283 |
|
284 |
#st.button(':speaker:', type='primary',on_click=generate_audio)
|
|
|
268 |
pdf_page_to_image('/home/user/app/pdf2image/output.pdf', page_number, '/home/user/app/pdf2image/output.png')
|
269 |
|
270 |
image = Image.open('/home/user/app/pdf2image/output.png')
|
271 |
+
st.sidebar.image(image)
|
272 |
st.session_state.image_displayed = True
|
273 |
+
#return image
|
274 |
|
275 |
def generate_audio():
|
276 |
sound_file = BytesIO()
|
277 |
tts = gTTS(result['result'], lang='en')
|
278 |
tts.write_to_fp(sound_file)
|
279 |
+
st.sidebar.audio(sound_file)
|
280 |
st.session_state.sound_played = True
|
281 |
+
#return sound_file
|
282 |
|
283 |
|
284 |
#st.button(':speaker:', type='primary',on_click=generate_audio)
|