Update app.py
Browse files
app.py
CHANGED
|
@@ -196,15 +196,16 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 196 |
st.session_state.audio = False
|
| 197 |
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
generate_pdf()
|
| 204 |
st.session_state['reference'] = '/home/user/app/pdf2image/output.png'
|
| 205 |
st.image(st.session_state['reference'])
|
| 206 |
|
| 207 |
-
|
|
|
|
| 208 |
with open('/home/user/app/audio/audio.mp3','wb') as sound_file:
|
| 209 |
tts = gTTS(result['result'], lang='en', tld = 'co.in')
|
| 210 |
tts.write_to_fp(sound_file)
|
|
|
|
| 196 |
st.session_state.audio = False
|
| 197 |
|
| 198 |
|
| 199 |
+
|
| 200 |
+
choice = st.radio("References and TTS",["Reference" , 'TTS'])
|
| 201 |
+
if choice == 'Reference':
|
| 202 |
+
with st.sidebar:
|
| 203 |
generate_pdf()
|
| 204 |
st.session_state['reference'] = '/home/user/app/pdf2image/output.png'
|
| 205 |
st.image(st.session_state['reference'])
|
| 206 |
|
| 207 |
+
if choice == 'TTS':
|
| 208 |
+
with st.sidebar:
|
| 209 |
with open('/home/user/app/audio/audio.mp3','wb') as sound_file:
|
| 210 |
tts = gTTS(result['result'], lang='en', tld = 'co.in')
|
| 211 |
tts.write_to_fp(sound_file)
|