s3nh commited on
Commit
07f3b15
·
verified ·
1 Parent(s): a7ebbd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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-eng")
35
  #tts_model.to("cuda")
36
- tokenizer_tss = AutoTokenizer.from_pretrained("facebook/mms-tts-eng")
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 = "You are an AI assistant. Please be kind and answer responsibly." ):
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