Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,10 @@ def generate_response(query):
|
|
22 |
]
|
23 |
|
24 |
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
|
|
25 |
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
26 |
-
result = tokenizer.decode(outputs, skip_special_tokens=True)
|
|
|
27 |
return result
|
28 |
|
29 |
# Gradio interface
|
|
|
22 |
]
|
23 |
|
24 |
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
25 |
+
print("raw intput: " + inputs)
|
26 |
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
27 |
+
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
28 |
+
print("raw output: " + result)
|
29 |
return result
|
30 |
|
31 |
# Gradio interface
|