Shangkhonil's picture
Create app.py
5bff31e verified
raw
history blame contribute delete
537 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text2text-generation", model="csebuetnlp/banglat5")
def generate_text(input_text):
output = pipe(input_text)
return output[0]['generated_text']
iface = gr.Interface(
fn=generate_text,
inputs=gr.inputs.Textbox(label="Input Text"),
outputs=gr.outputs.Textbox(label="Generated Text"),
title="Bangla Text Generation",
description="Generate text based on the input using the Bangla T5 model."
)
if __name__ == "__main__":
iface.launch()