雷娃 commited on
Commit
5898c17
·
1 Parent(s): 5c07d1c

add interactive mode

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ model = AutoModelForCausalLM.from_pretrained(
16
  ).eval()
17
 
18
  # define chat function
19
- def chat(user_input, max_new_tokens=100000):
20
  # chat history
21
  messages = [
22
  {"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
@@ -49,7 +49,7 @@ interface = gr.Interface(
49
  fn=chat,
50
  inputs=[
51
  gr.Textbox(lines=8, label="输入你的问题"),
52
- gr.Slider(minimum=100, maximum=1024, step=50, label="生成长度")
53
  ],
54
  outputs=[
55
  gr.Textbox(lines=8, label="模型回复")
 
16
  ).eval()
17
 
18
  # define chat function
19
+ def chat(user_input, max_new_tokens=102400):
20
  # chat history
21
  messages = [
22
  {"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
 
49
  fn=chat,
50
  inputs=[
51
  gr.Textbox(lines=8, label="输入你的问题"),
52
+ gr.Slider(minimum=100, maximum=102400, step=50, label="生成长度")
53
  ],
54
  outputs=[
55
  gr.Textbox(lines=8, label="模型回复")