Spaces:
Sleeping
Sleeping
Commit
路
e7afa69
1
Parent(s):
06e5edd
commit
Browse files
app.py
CHANGED
|
@@ -50,8 +50,8 @@ def mejorar_resolucion(context, borrador, api_url, headers, max_length=1000):
|
|
| 50 |
|
| 51 |
result = query(api_url, headers, payload)
|
| 52 |
|
| 53 |
-
if result and isinstance(result,
|
| 54 |
-
texto_generado = result[
|
| 55 |
context += f"\n\n{texto_generado}"
|
| 56 |
logging.info(f"Prompt: {prompt}\nGenerated: {texto_generado.strip()}")
|
| 57 |
return texto_generado.strip(), context
|
|
@@ -93,7 +93,7 @@ async def api_predict(request: Request):
|
|
| 93 |
|
| 94 |
# Crear y lanzar la interfaz de Gradio
|
| 95 |
iface = gr.ChatInterface(predict)
|
| 96 |
-
iface.launch()
|
| 97 |
|
| 98 |
# Ejecutar la aplicaci贸n FastAPI
|
| 99 |
if __name__ == "__main__":
|
|
|
|
| 50 |
|
| 51 |
result = query(api_url, headers, payload)
|
| 52 |
|
| 53 |
+
if result and isinstance(result, dict) and result.get('generated_text'):
|
| 54 |
+
texto_generado = result['generated_text']
|
| 55 |
context += f"\n\n{texto_generado}"
|
| 56 |
logging.info(f"Prompt: {prompt}\nGenerated: {texto_generado.strip()}")
|
| 57 |
return texto_generado.strip(), context
|
|
|
|
| 93 |
|
| 94 |
# Crear y lanzar la interfaz de Gradio
|
| 95 |
iface = gr.ChatInterface(predict)
|
| 96 |
+
iface.launch(share=True)
|
| 97 |
|
| 98 |
# Ejecutar la aplicaci贸n FastAPI
|
| 99 |
if __name__ == "__main__":
|