Spaces:
Runtime error
Runtime error
# Use a pipeline as a high-level helper | |
from transformers import pipeline | |
pipe = pipeline("text-generation", model="somosnlp/Phi-2-LenguajeClaro", trust_remote_code=True) | |
import gradio as gr | |
def eval_text (text): | |
new_prompt = f"""###System: Lee el siguiente texto y hazlo más claro: | |
###Texto: | |
{text} | |
###Texto aclarado: | |
""" | |
result = pipe(new_prompt, max_length=2000) | |
return (result[0]['generated_text']) | |
demo = gr.Interface(fn=eval_text, inputs="text", outputs="text", title="Lenguaje Claro") | |
demo.launch() |