Spaces:
Runtime error
Runtime error
YanshekWoo
commited on
Commit
•
e2a77ad
1
Parent(s):
7e3a12b
ADD examples
Browse files
app.py
CHANGED
@@ -17,6 +17,10 @@ model = BartForConditionalGeneration.from_pretrained("HIT-TMG/dialogue-bart-larg
|
|
17 |
tokenizer.truncation_side = 'left'
|
18 |
max_length = 512
|
19 |
|
|
|
|
|
|
|
|
|
20 |
|
21 |
def chat_func(input_utterance: str, history: Optional[List[str]] = None):
|
22 |
if history is not None:
|
@@ -54,6 +58,7 @@ demo = gr.Interface(fn=chat_func,
|
|
54 |
title=title,
|
55 |
description=description,
|
56 |
inputs=[gr.Textbox(lines=1, placeholder="Input current utterance"), "state"],
|
|
|
57 |
outputs=["chatbot", "state"])
|
58 |
|
59 |
|
|
|
17 |
tokenizer.truncation_side = 'left'
|
18 |
max_length = 512
|
19 |
|
20 |
+
examples = [
|
21 |
+
["你好。[SEP]嘿嘿你好,请问你最近在忙什么呢?[SEP]我最近养了一只狗狗,我在训练它呢。"]
|
22 |
+
]
|
23 |
+
|
24 |
|
25 |
def chat_func(input_utterance: str, history: Optional[List[str]] = None):
|
26 |
if history is not None:
|
|
|
58 |
title=title,
|
59 |
description=description,
|
60 |
inputs=[gr.Textbox(lines=1, placeholder="Input current utterance"), "state"],
|
61 |
+
examples=examples,
|
62 |
outputs=["chatbot", "state"])
|
63 |
|
64 |
|