Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,9 @@ def load_whisper():
|
|
31 |
return whisper.load_model("medium", device = 'cpu')
|
32 |
|
33 |
def load_tts():
|
34 |
-
tts_model = VitsModel.from_pretrained("facebook/mms-tts-
|
35 |
#tts_model.to("cuda")
|
36 |
-
tokenizer_tss = AutoTokenizer.from_pretrained("facebook/mms-tts-
|
37 |
return tts_model, tokenizer_tss
|
38 |
|
39 |
|
@@ -109,7 +109,7 @@ def predict(_query, _chatbot, _task_history):
|
|
109 |
_chatbot.append((_parse_text(_query), ""))
|
110 |
full_response = ""
|
111 |
|
112 |
-
for response in model.chat_stream(tokenizer, _query, history=_task_history,system = "
|
113 |
_chatbot[-1] = (_parse_text(_query), _parse_text(response))
|
114 |
|
115 |
yield _chatbot
|
|
|
31 |
return whisper.load_model("medium", device = 'cpu')
|
32 |
|
33 |
def load_tts():
|
34 |
+
tts_model = VitsModel.from_pretrained("facebook/mms-tts-pl")
|
35 |
#tts_model.to("cuda")
|
36 |
+
tokenizer_tss = AutoTokenizer.from_pretrained("facebook/mms-tts-pl")
|
37 |
return tts_model, tokenizer_tss
|
38 |
|
39 |
|
|
|
109 |
_chatbot.append((_parse_text(_query), ""))
|
110 |
full_response = ""
|
111 |
|
112 |
+
for response in model.chat_stream(tokenizer, _query, history=_task_history,system = "Jesteś asystentem AI. Odpowiadaj grzecznie i w języku polskim :)" ):
|
113 |
_chatbot[-1] = (_parse_text(_query), _parse_text(response))
|
114 |
|
115 |
yield _chatbot
|