Kosuke-Yamada commited on
Commit
7ebe818
Β·
verified Β·
1 Parent(s): 7881e74

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ model_repository_name = "Kosuke-Yamada/t5_ad_generation"
4
+ ad_pipeline = pipeline("text2text-generation", model_repository_name, no_repeat_ngram_size=1)
5
+
6
+ def main(text):
7
+ return ad_pipeline(text)[0]["generated_text"]
8
+
9
+ with gr.Blocks() as demo:
10
+ with gr.Row():
11
+ with gr.Column():
12
+ gr.Markdown("# εΊƒε‘Šη”Ÿζˆγƒ‡γƒ’")
13
+
14
+ input_text = gr.components.Textbox(lines=1, label="γ‚­γƒΌγƒ―γƒΌγƒ‰γ‚’η©Ίη™½εŒΊεˆ‡γ‚Šγ§ε…₯εŠ›γ—γ¦οΌ")
15
+ submit_button = gr.Button("Submit")
16
+ output_text = gr.components.Textbox(lines=1, label="η”ŸζˆεΊƒε‘Š")
17
+
18
+ submit_button.click(main, inputs=[input_text], outputs=[output_text])
19
+ demo.launch()