KvrParaskevi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def render_chat_history(chat_history):
|
|
29 |
|
30 |
def generate_response(chat_history):
|
31 |
tokenized_chat = tokenizer.apply_chat_template(chat_history, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
32 |
-
outputs = model.generate(tokenized_chat, do_sample =True, max_new_tokens=50, temperature = 0.3, top_p = 0.
|
33 |
answer = tokenizer.decode(outputs[0][tokenized_chat.shape[1]:],skip_special_tokens=True)
|
34 |
final_answer = answer.split("<")[0]
|
35 |
return final_answer
|
|
|
29 |
|
30 |
def generate_response(chat_history):
|
31 |
tokenized_chat = tokenizer.apply_chat_template(chat_history, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
32 |
+
outputs = model.generate(tokenized_chat, do_sample =True, max_new_tokens=50, temperature = 0.3, top_p = 0.85)
|
33 |
answer = tokenizer.decode(outputs[0][tokenized_chat.shape[1]:],skip_special_tokens=True)
|
34 |
final_answer = answer.split("<")[0]
|
35 |
return final_answer
|