Spaces:
Runtime error
Runtime error
Shangkhonil
commited on
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
pipe = pipeline("text2text-generation", model="csebuetnlp/banglat5")
|
4 |
+
|
5 |
+
def generate_text(input_text):
|
6 |
+
output = pipe(input_text)
|
7 |
+
return output[0]['generated_text']
|
8 |
+
|
9 |
+
iface = gr.Interface(
|
10 |
+
fn=generate_text,
|
11 |
+
inputs=gr.inputs.Textbox(label="Input Text"),
|
12 |
+
outputs=gr.outputs.Textbox(label="Generated Text"),
|
13 |
+
title="Bangla Text Generation",
|
14 |
+
description="Generate text based on the input using the Bangla T5 model."
|
15 |
+
)
|
16 |
+
if __name__ == "__main__":
|
17 |
+
iface.launch()
|