Ruurd commited on
Commit
68ccec0
·
1 Parent(s): 9ed028b

set pad and eos tokens

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -23,9 +23,6 @@ def chat_with_model(messages):
23
  yield messages + [{"role": "assistant", "content": "⚠️ No model loaded."}]
24
  return
25
 
26
- print("EOS token ID:", current_tokenizer.eos_token_id)
27
- print(current_model.generation_config)
28
-
29
  current_model.to("cuda").half()
30
 
31
  prompt = format_prompt(messages)
@@ -39,7 +36,9 @@ def chat_with_model(messages):
39
  max_new_tokens=256,
40
  do_sample=True,
41
  streamer=streamer,
42
- stopping_criteria=stopping_criteria
 
 
43
  )
44
 
45
  thread = threading.Thread(target=current_model.generate, kwargs=generation_kwargs)
 
23
  yield messages + [{"role": "assistant", "content": "⚠️ No model loaded."}]
24
  return
25
 
 
 
 
26
  current_model.to("cuda").half()
27
 
28
  prompt = format_prompt(messages)
 
36
  max_new_tokens=256,
37
  do_sample=True,
38
  streamer=streamer,
39
+ stopping_criteria=stopping_criteria,
40
+ eos_token_id=current_tokenizer.eos_token_id,
41
+ pad_token_id=pad_id
42
  )
43
 
44
  thread = threading.Thread(target=current_model.generate, kwargs=generation_kwargs)