Spaces:
Runtime error
Runtime error
AchyuthGamer
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from gtts import gTTS
|
|
5 |
import os
|
6 |
|
7 |
# Constants
|
8 |
-
TITLE = "
|
9 |
DESCRIPTION = """
|
10 |
----
|
11 |
OpenGPT - ChatGPT's Nightmare π
|
@@ -72,13 +72,13 @@ if wav_audio_data is not None:
|
|
72 |
prompt = transcribe("audio.wav")
|
73 |
st.write("Transcribed Given Audio β")
|
74 |
|
75 |
-
st.chat_message("human", avatar="
|
76 |
st.session_state.messages.append({"role": "human", "content": prompt})
|
77 |
|
78 |
# transcribe audio
|
79 |
response = predict(message=prompt)
|
80 |
|
81 |
-
with st.chat_message("assistant", avatar='
|
82 |
st.markdown(response)
|
83 |
|
84 |
# Convert AI response to speech
|
@@ -93,7 +93,7 @@ if wav_audio_data is not None:
|
|
93 |
# React to user input
|
94 |
if prompt := textinput:
|
95 |
# Display user message in chat message container
|
96 |
-
st.chat_message("human", avatar="
|
97 |
# Add user message to chat history
|
98 |
st.session_state.messages.append({"role": "human", "content": prompt})
|
99 |
|
@@ -103,7 +103,7 @@ if prompt := textinput:
|
|
103 |
speech_file = text_to_speech(response)
|
104 |
|
105 |
# Display assistant response in chat message container
|
106 |
-
with st.chat_message("assistant", avatar='
|
107 |
st.markdown(response)
|
108 |
|
109 |
# Play the generated speech
|
|
|
5 |
import os
|
6 |
|
7 |
# Constants
|
8 |
+
TITLE = "OpenGPT"
|
9 |
DESCRIPTION = """
|
10 |
----
|
11 |
OpenGPT - ChatGPT's Nightmare π
|
|
|
72 |
prompt = transcribe("audio.wav")
|
73 |
st.write("Transcribed Given Audio β")
|
74 |
|
75 |
+
st.chat_message("human", avatar="π").markdown(prompt)
|
76 |
st.session_state.messages.append({"role": "human", "content": prompt})
|
77 |
|
78 |
# transcribe audio
|
79 |
response = predict(message=prompt)
|
80 |
|
81 |
+
with st.chat_message("assistant", avatar='π'):
|
82 |
st.markdown(response)
|
83 |
|
84 |
# Convert AI response to speech
|
|
|
93 |
# React to user input
|
94 |
if prompt := textinput:
|
95 |
# Display user message in chat message container
|
96 |
+
st.chat_message("human", avatar="π").markdown(prompt)
|
97 |
# Add user message to chat history
|
98 |
st.session_state.messages.append({"role": "human", "content": prompt})
|
99 |
|
|
|
103 |
speech_file = text_to_speech(response)
|
104 |
|
105 |
# Display assistant response in chat message container
|
106 |
+
with st.chat_message("assistant", avatar='π'):
|
107 |
st.markdown(response)
|
108 |
|
109 |
# Play the generated speech
|