Spaces:
Running
Running
雷娃
commited on
Commit
·
f29c587
1
Parent(s):
81390b6
add interactive mode
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
15 |
).eval()
|
16 |
|
17 |
# define chat function
|
18 |
-
def chat(user_input, max_new_tokens=
|
19 |
# chat history
|
20 |
messages = [
|
21 |
{"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
|
@@ -51,8 +51,7 @@ interface = gr.Interface(
|
|
51 |
gr.Slider(minimum=100, maximum=1024, step=50, label="生成长度")
|
52 |
],
|
53 |
outputs=[
|
54 |
-
gr.Textbox(lines=8, label="模型回复")
|
55 |
-
gr.Textbox(label="耗时", interactive=False)
|
56 |
],
|
57 |
title="Ling-lite-1.5 MoE 模型 Demo",
|
58 |
description="基于 [inclusionAI/Ling-lite-1.5](https://huggingface.co/inclusionAI/Ling-lite-1.5) 的对话式文本生成演示。",
|
|
|
15 |
).eval()
|
16 |
|
17 |
# define chat function
|
18 |
+
def chat(user_input, max_new_tokens=512):
|
19 |
# chat history
|
20 |
messages = [
|
21 |
{"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
|
|
|
51 |
gr.Slider(minimum=100, maximum=1024, step=50, label="生成长度")
|
52 |
],
|
53 |
outputs=[
|
54 |
+
gr.Textbox(lines=8, label="模型回复")
|
|
|
55 |
],
|
56 |
title="Ling-lite-1.5 MoE 模型 Demo",
|
57 |
description="基于 [inclusionAI/Ling-lite-1.5](https://huggingface.co/inclusionAI/Ling-lite-1.5) 的对话式文本生成演示。",
|