fix
Browse files
app.py
CHANGED
@@ -61,6 +61,10 @@ def chat_with_model(messages):
|
|
61 |
if pad_id is None:
|
62 |
pad_id = current_tokenizer.unk_token_id or 0
|
63 |
|
|
|
|
|
|
|
|
|
64 |
prompt = format_prompt(messages)
|
65 |
device = torch.device("cuda")
|
66 |
current_model.to(device).half()
|
@@ -80,7 +84,7 @@ def chat_with_model(messages):
|
|
80 |
# 3. Build generation kwargs
|
81 |
generation_kwargs = dict(
|
82 |
**inputs,
|
83 |
-
max_new_tokens=
|
84 |
do_sample=True,
|
85 |
streamer=streamer,
|
86 |
eos_token_id=eos_id,
|
|
|
61 |
if pad_id is None:
|
62 |
pad_id = current_tokenizer.unk_token_id or 0
|
63 |
|
64 |
+
output_text = ""
|
65 |
+
in_think = False
|
66 |
+
max_new_tokens = 256
|
67 |
+
|
68 |
prompt = format_prompt(messages)
|
69 |
device = torch.device("cuda")
|
70 |
current_model.to(device).half()
|
|
|
84 |
# 3. Build generation kwargs
|
85 |
generation_kwargs = dict(
|
86 |
**inputs,
|
87 |
+
max_new_tokens=max_new_tokens,
|
88 |
do_sample=True,
|
89 |
streamer=streamer,
|
90 |
eos_token_id=eos_id,
|