Spaces:
Runtime error
Runtime error
Commit
·
7c23fa8
1
Parent(s):
415b889
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def gen_conversation(text,max_new_tokens=100):
|
|
| 39 |
early_stopping = True,
|
| 40 |
no_repeat_ngram_size=2,
|
| 41 |
repetition_penalty=1.2,
|
| 42 |
-
temperature=.
|
| 43 |
num_beams=3
|
| 44 |
)
|
| 45 |
gc.collect()
|
|
@@ -57,10 +57,10 @@ def speech_to_text(audio_file, texto_adicional):
|
|
| 57 |
text_enrada=""
|
| 58 |
|
| 59 |
texto_generado = r.recognize_google(audio, language="es-ES")
|
| 60 |
-
texto_generado= f"[|Audio a texto|]:{texto_generado}\n" + "<br>[AGENTE]:"+gen_conversation(texto_generado,max_new_tokens=
|
| 61 |
texto_generado = "<div style='color: #66b3ff;'>" + texto_generado + "</div><br>"
|
| 62 |
else:
|
| 63 |
-
texto_generado= f"[|Solo texto|]:{texto_adicional}\n" + "<br>[AGENTE]:"+gen_conversation(texto_adicional,max_new_tokens=
|
| 64 |
texto_generado = "<div style='color: #66b3ff;'> " + texto_generado + "</div><br>"
|
| 65 |
conversacion += texto_generado
|
| 66 |
return conversacion
|
|
|
|
| 39 |
early_stopping = True,
|
| 40 |
no_repeat_ngram_size=2,
|
| 41 |
repetition_penalty=1.2,
|
| 42 |
+
temperature=.9,
|
| 43 |
num_beams=3
|
| 44 |
)
|
| 45 |
gc.collect()
|
|
|
|
| 57 |
text_enrada=""
|
| 58 |
|
| 59 |
texto_generado = r.recognize_google(audio, language="es-ES")
|
| 60 |
+
texto_generado= f"[|Audio a texto|]:{texto_generado}\n" + "<br>[AGENTE]:"+gen_conversation(texto_generado,max_new_tokens=500)
|
| 61 |
texto_generado = "<div style='color: #66b3ff;'>" + texto_generado + "</div><br>"
|
| 62 |
else:
|
| 63 |
+
texto_generado= f"[|Solo texto|]:{texto_adicional}\n" + "<br>[AGENTE]:"+gen_conversation(texto_adicional,max_new_tokens=500)
|
| 64 |
texto_generado = "<div style='color: #66b3ff;'> " + texto_generado + "</div><br>"
|
| 65 |
conversacion += texto_generado
|
| 66 |
return conversacion
|