Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def predict(_query, _chatbot, _task_history):
|
|
| 115 |
_task_history.append((_query, full_response))
|
| 116 |
print(f"Qwen-7B-Chat: {_parse_text(full_response)}")
|
| 117 |
|
| 118 |
-
|
| 119 |
def read_text(text):
|
| 120 |
print("___Tekst do przeczytania!")
|
| 121 |
inputs = tokenizer_tss(text, return_tensors="pt").to("cuda")
|
|
@@ -127,13 +127,14 @@ def read_text(text):
|
|
| 127 |
|
| 128 |
def update_audio(text):
|
| 129 |
return 'temp_file.wav'
|
| 130 |
-
|
|
|
|
| 131 |
def translate(audio):
|
| 132 |
print("__Wysyłam nagranie do whisper!")
|
| 133 |
transcription = whisper_model.transcribe(audio, language="pl")
|
| 134 |
return transcription["text"]
|
| 135 |
|
| 136 |
-
|
| 137 |
def predict(audio, _chatbot, _task_history):
|
| 138 |
# Użyj funkcji translate, aby przekształcić audio w tekst
|
| 139 |
_query = translate(audio)
|
|
|
|
| 115 |
_task_history.append((_query, full_response))
|
| 116 |
print(f"Qwen-7B-Chat: {_parse_text(full_response)}")
|
| 117 |
|
| 118 |
+
|
| 119 |
def read_text(text):
|
| 120 |
print("___Tekst do przeczytania!")
|
| 121 |
inputs = tokenizer_tss(text, return_tensors="pt").to("cuda")
|
|
|
|
| 127 |
|
| 128 |
def update_audio(text):
|
| 129 |
return 'temp_file.wav'
|
| 130 |
+
|
| 131 |
+
|
| 132 |
def translate(audio):
|
| 133 |
print("__Wysyłam nagranie do whisper!")
|
| 134 |
transcription = whisper_model.transcribe(audio, language="pl")
|
| 135 |
return transcription["text"]
|
| 136 |
|
| 137 |
+
|
| 138 |
def predict(audio, _chatbot, _task_history):
|
| 139 |
# Użyj funkcji translate, aby przekształcić audio w tekst
|
| 140 |
_query = translate(audio)
|