Kosuke-Yamada commited on
Commit
6249bac
β€’
1 Parent(s): a50a7dd

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
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()