Spaces:
Running
Running
Kosuke-Yamada
commited on
Commit
β’
6249bac
1
Parent(s):
a50a7dd
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model_repository_name = "Kosuke-Yamada/t5_ad_generation"
|
5 |
+
ad_pipeline = pipeline("text2text-generation", model_repository_name, no_repeat_ngram_size=1)
|
6 |
+
|
7 |
+
def main(text):
|
8 |
+
return ad_pipeline(text)[0]["generated_text"]
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
with gr.Row():
|
12 |
+
with gr.Column():
|
13 |
+
gr.Markdown("# εΊεηζγγ’")
|
14 |
+
|
15 |
+
input_text = gr.components.Textbox(lines=1, label="γγΌγ―γΌγγη©Ίη½εΊεγγ§ε
₯εγγ¦οΌ")
|
16 |
+
submit_button = gr.Button("Submit")
|
17 |
+
output_text = gr.components.Textbox(lines=1, label="ηζεΊε")
|
18 |
+
|
19 |
+
submit_button.click(main, inputs=[input_text], outputs=[output_text])
|
20 |
+
demo.launch()
|