File size: 1,100 Bytes
b6198c3
 
977595f
b6198c3
 
 
d6a85e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from util import pipeline
from util import load_model
import gradio as gr

cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented2'

# def get_model():
#     checkpoint = cp_aug 
#     tokenizer, model = load_model(checkpoint)
#     return tokenizer, model

# tokenizer, model = get_model()

# def generate_summary(input_text):
#     return pipeline(input_text)

# demo = gr.Interface(
#     fn=generate_summary,
#     inputs=gr.Textbox(lines=2, placeholder="Enter your URL..."),
#     outputs=gr.Textbox(label="Generated Text"),
#     title="Chào mừng đến với hệ thống tóm tắt của Minne >.<",
#     description="Enter the URL to summarize and click 'Submit' to generate the summary."
# )

import gradio as gr
def update(name):
    return f"Welcome to Gradio, {name}!"

with gr.Blocks() as demo:
    gr.Markdown("Start typing below and then click **Run** to see the output.")
    with gr.Row():
        inp = gr.Textbox(placeholder="What is your name?")
        out = gr.Textbox()
    btn = gr.Button("Run")
    btn.click(fn=update, inputs=inp, outputs=out)

demo.launch()