Spaces:
Sleeping
Sleeping
SuganthKrishna2003
commited on
Commit
•
24be09f
1
Parent(s):
53e5a1a
Update app.py
Browse files
app.py
CHANGED
@@ -98,18 +98,16 @@ response = get_completion(prompt)
|
|
98 |
|
99 |
print(response)
|
100 |
|
101 |
-
#
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
|
106 |
-
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
speech_output = tts_model.generate(**inputs).cpu().numpy()
|
111 |
-
|
112 |
-
# Output of generated speech
|
113 |
-
|
114 |
-
sampling_rate = tts_model.generation_config.sample_rate
|
115 |
-
Audio(speech_output[0], rate=sampling_rate)
|
|
|
98 |
|
99 |
print(response)
|
100 |
|
101 |
+
# Import the Gtts module for text
|
102 |
+
# to speech conversion
|
103 |
+
from gtts import gTTS
|
104 |
+
|
105 |
+
# import Os module to start the audio file
|
106 |
+
import os
|
107 |
|
108 |
+
# Language we want to use
|
109 |
+
language = 'en'
|
110 |
|
111 |
+
output = gTTS(text=response, lang=language, slow=False)
|
112 |
|
113 |
+
Audio(output,rate=24000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|