AchyuthGamer commited on
Commit
5cfdee0
Β·
verified Β·
1 Parent(s): 8a32c85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,7 +5,7 @@ from gtts import gTTS
5
  import os
6
 
7
  # Constants
8
- TITLE = "AgriTure"
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="🌿").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,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="🌿").markdown(prompt)
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