Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -130,7 +130,7 @@ def translate(audio):
|
|
130 |
transcription = whisper_model.transcribe(audio, language="pl")
|
131 |
return transcription["text"]
|
132 |
|
133 |
-
|
134 |
def predict(audio, _chatbot, _task_history):
|
135 |
# Użyj funkcji translate, aby przekształcić audio w tekst
|
136 |
_query = translate(audio)
|
@@ -162,7 +162,7 @@ def regenerate(_chatbot, _task_history):
|
|
162 |
_chatbot.pop(-1)
|
163 |
yield from predict(item[0], _chatbot, _task_history)
|
164 |
|
165 |
-
|
166 |
with gr.Blocks() as chat_demo:
|
167 |
chatbot = gr.Chatbot(label='Llama Voice Chatbot', elem_classes="control-height")
|
168 |
query = gr.Textbox(lines=2, label='Input')
|
|
|
130 |
transcription = whisper_model.transcribe(audio, language="pl")
|
131 |
return transcription["text"]
|
132 |
|
133 |
+
@spaces.GPU
|
134 |
def predict(audio, _chatbot, _task_history):
|
135 |
# Użyj funkcji translate, aby przekształcić audio w tekst
|
136 |
_query = translate(audio)
|
|
|
162 |
_chatbot.pop(-1)
|
163 |
yield from predict(item[0], _chatbot, _task_history)
|
164 |
|
165 |
+
|
166 |
with gr.Blocks() as chat_demo:
|
167 |
chatbot = gr.Chatbot(label='Llama Voice Chatbot', elem_classes="control-height")
|
168 |
query = gr.Textbox(lines=2, label='Input')
|