Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,12 @@ pipe = pipeline("text-generation", model="somosnlp/Phi-2-LenguajeClaro", trust_r
|
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
def eval_text (text):
|
| 9 |
-
new_prompt = f"""###System: Lee el siguiente texto y hazlo más claro:
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
return (result[0]['generated_text'])
|
| 12 |
|
| 13 |
demo = gr.Interface(fn=eval_text, inputs="text", outputs="text", title="Lenguaje Claro")
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
def eval_text (text):
|
| 9 |
+
new_prompt = f"""###System: Lee el siguiente texto y hazlo más claro:
|
| 10 |
+
###Texto:
|
| 11 |
+
{text}
|
| 12 |
+
###Texto aclarado:
|
| 13 |
+
"""
|
| 14 |
+
result = pipe(new_prompt, max_length=500)
|
| 15 |
return (result[0]['generated_text'])
|
| 16 |
|
| 17 |
demo = gr.Interface(fn=eval_text, inputs="text", outputs="text", title="Lenguaje Claro")
|