File size: 402 Bytes
f720cbd
 
 
f100609
b17dcb2
 
 
 
3e96643
 
b17dcb2
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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):
    result = pipe(text, max_length=200)
    return (result[0]['generated_text'])

demo = gr.Interface(fn=eval_text, inputs="text", outputs="text", title="Lenguaje Claro") 

demo.launch()