Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,12 +38,15 @@ def respond(
|
|
38 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
39 |
inputs = inputs.to("cuda")
|
40 |
|
|
|
|
|
41 |
# Generate response
|
42 |
generate_ids = model.generate(
|
43 |
inputs,
|
44 |
max_length=max_tokens,
|
45 |
temperature=temperature,
|
46 |
-
top_p=top_p
|
|
|
47 |
)
|
48 |
|
49 |
# Decode the generated response
|
|
|
38 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
|
39 |
inputs = inputs.to("cuda")
|
40 |
|
41 |
+
print("eos_token_id: ", tokenizer.eos_token_id)
|
42 |
+
|
43 |
# Generate response
|
44 |
generate_ids = model.generate(
|
45 |
inputs,
|
46 |
max_length=max_tokens,
|
47 |
temperature=temperature,
|
48 |
+
top_p=top_p,
|
49 |
+
eos_token_id=tokenizer.eos_token_id,
|
50 |
)
|
51 |
|
52 |
# Decode the generated response
|