VestibulaIA / app.py
DHEIVER's picture
Update app.py
c22a077
raw
history blame
No virus
594 Bytes
import gradio as gr
from transformers import pipeline
# Load the pipeline
pipe = pipeline("text-generation", model="bigscience/bloom-560m")
# Define a function to generate text using the pipeline
def generate_text(prompt):
generated_text = pipe(prompt, max_length=100)[0]['generated_text']
return generated_text
# Create a Gradio interface
interface = gr.Interface(
fn=generate_text,
inputs=gr.Textbox("text", label="Digite seu texto aqui:", lines=5),
outputs=gr.Textbox("text", label="Texto Gerado:")
)
# Incluir texto em português para a interface
interface.launch()