Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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=
|
|
|
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)
|