Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ Respuesta:
|
|
53 |
payload = {
|
54 |
"inputs": prompt,
|
55 |
"parameters": {
|
56 |
-
"max_new_tokens":
|
57 |
"temperature": 0.7,
|
58 |
"top_p": 0.95
|
59 |
}
|
@@ -63,10 +63,15 @@ Respuesta:
|
|
63 |
result = response.json()
|
64 |
|
65 |
if isinstance(result, list):
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
demo = gr.Interface(
|
72 |
fn=accionar_ai,
|
|
|
53 |
payload = {
|
54 |
"inputs": prompt,
|
55 |
"parameters": {
|
56 |
+
"max_new_tokens": 180,
|
57 |
"temperature": 0.7,
|
58 |
"top_p": 0.95
|
59 |
}
|
|
|
63 |
result = response.json()
|
64 |
|
65 |
if isinstance(result, list):
|
66 |
+
generated = result[0].get("generated_text", "").strip()
|
67 |
+
|
68 |
+
# Extraer solo lo que viene despu茅s de la 煤ltima aparici贸n de "Respuesta:"
|
69 |
+
if "Respuesta:" in generated:
|
70 |
+
texto_final = generated.split("Respuesta:")[-1].strip()
|
71 |
+
else:
|
72 |
+
texto_final = generated
|
73 |
+
|
74 |
+
return texto_final
|
75 |
|
76 |
demo = gr.Interface(
|
77 |
fn=accionar_ai,
|