File size: 726 Bytes
284d20c
7ebe818
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from transformers import pipeline
import gradio as gr

model_repository_name = "Kosuke-Yamada/t5_ad_generation"
ad_pipeline = pipeline("text2text-generation", model_repository_name, no_repeat_ngram_size=1)

def main(text):
    return ad_pipeline(text)[0]["generated_text"]

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            gr.Markdown("# εΊƒε‘Šη”Ÿζˆγƒ‡γƒ’")

            input_text = gr.components.Textbox(lines=1, label="γ‚­γƒΌγƒ―γƒΌγƒ‰γ‚’η©Ίη™½εŒΊεˆ‡γ‚Šγ§ε…₯εŠ›γ—γ¦οΌ")
            submit_button = gr.Button("Submit")
            output_text = gr.components.Textbox(lines=1, label="η”ŸζˆεΊƒε‘Š")

    submit_button.click(main, inputs=[input_text], outputs=[output_text])
demo.launch()