Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ class Dost:
|
|
| 29 |
result = whisper.decode(model, mel, options)
|
| 30 |
|
| 31 |
print("-------------------RECOGNIZE---------------------")
|
| 32 |
-
print(
|
| 33 |
self.response(result.text, lang)
|
| 34 |
|
| 35 |
def response(self, prompt, lang):
|
|
@@ -45,7 +45,7 @@ class Dost:
|
|
| 45 |
)
|
| 46 |
choice = response['choices'][0]['text']
|
| 47 |
print("-------------------RESPONSE---------------------")
|
| 48 |
-
print(
|
| 49 |
self.convHistory.append((prompt, choice))
|
| 50 |
self.result.append(self.convHistory)
|
| 51 |
print(self.convHistory[0])
|
|
@@ -59,7 +59,7 @@ class Dost:
|
|
| 59 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
| 60 |
self.coquiTTS.get_tts(text, fp, speaker = {"language" : language})
|
| 61 |
print("-------------------AUDIOOUTPUT---------------------")
|
| 62 |
-
print(
|
| 63 |
self.result.append(fp.name)
|
| 64 |
|
| 65 |
def start(self, audio, state):
|
|
|
|
| 29 |
result = whisper.decode(model, mel, options)
|
| 30 |
|
| 31 |
print("-------------------RECOGNIZE---------------------")
|
| 32 |
+
print(result)
|
| 33 |
self.response(result.text, lang)
|
| 34 |
|
| 35 |
def response(self, prompt, lang):
|
|
|
|
| 45 |
)
|
| 46 |
choice = response['choices'][0]['text']
|
| 47 |
print("-------------------RESPONSE---------------------")
|
| 48 |
+
print(choice)
|
| 49 |
self.convHistory.append((prompt, choice))
|
| 50 |
self.result.append(self.convHistory)
|
| 51 |
print(self.convHistory[0])
|
|
|
|
| 59 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
| 60 |
self.coquiTTS.get_tts(text, fp, speaker = {"language" : language})
|
| 61 |
print("-------------------AUDIOOUTPUT---------------------")
|
| 62 |
+
print("DONE", fp.name)
|
| 63 |
self.result.append(fp.name)
|
| 64 |
|
| 65 |
def start(self, audio, state):
|