Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,23 +4,35 @@ import gradio as gr
|
|
| 4 |
|
| 5 |
cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented2'
|
| 6 |
|
| 7 |
-
def get_model():
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
tokenizer, model = get_model()
|
| 13 |
-
|
| 14 |
-
def generate_summary(input_text):
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
demo = gr.Interface(
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented2'
|
| 6 |
|
| 7 |
+
# def get_model():
|
| 8 |
+
# checkpoint = cp_aug
|
| 9 |
+
# tokenizer, model = load_model(checkpoint)
|
| 10 |
+
# return tokenizer, model
|
| 11 |
+
|
| 12 |
+
# tokenizer, model = get_model()
|
| 13 |
+
|
| 14 |
+
# def generate_summary(input_text):
|
| 15 |
+
# return pipeline(input_text)
|
| 16 |
+
|
| 17 |
+
# demo = gr.Interface(
|
| 18 |
+
# fn=generate_summary,
|
| 19 |
+
# inputs=gr.Textbox(lines=2, placeholder="Enter your URL..."),
|
| 20 |
+
# outputs=gr.Textbox(label="Generated Text"),
|
| 21 |
+
# title="Chào mừng đến với hệ thống tóm tắt của Minne >.<",
|
| 22 |
+
# description="Enter the URL to summarize and click 'Submit' to generate the summary."
|
| 23 |
+
# )
|
| 24 |
+
|
| 25 |
+
import gradio as gr
|
| 26 |
+
def update(name):
|
| 27 |
+
return f"Welcome to Gradio, {name}!"
|
| 28 |
+
|
| 29 |
+
with gr.Blocks() as demo:
|
| 30 |
+
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
| 31 |
+
with gr.Row():
|
| 32 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
| 33 |
+
out = gr.Textbox()
|
| 34 |
+
btn = gr.Button("Run")
|
| 35 |
+
btn.click(fn=update, inputs=inp, outputs=out)
|
| 36 |
+
|
| 37 |
+
demo.launch()
|
| 38 |
+
|