puffy310 commited on
Commit
bd48d11
·
verified ·
1 Parent(s): 2076374

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -9,7 +9,8 @@ model = AutoModelForCausalLM.from_pretrained("BirdL/DeepSeek-Coder-V2-Lite-Instr
9
  @spaces.GPU
10
  def respond(message, history):
11
  inputs = tokenizer.apply_chat_template(message, add_generation_prompt=True, return_tensors="pt").to(model.device)
12
- outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
 
13
  return outputs
14
 
15
  demo = gr.ChatInterface(respond)
 
9
  @spaces.GPU
10
  def respond(message, history):
11
  inputs = tokenizer.apply_chat_template(message, add_generation_prompt=True, return_tensors="pt").to(model.device)
12
+ outputs = model.generate(inputs, max_new_tokens=192, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
13
+ ouputs = (tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
14
  return outputs
15
 
16
  demo = gr.ChatInterface(respond)