keitokei1994 commited on
Commit
0844d7e
1 Parent(s): 8cd0748

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -20,10 +20,10 @@ quantization_config = BitsAndBytesConfig(
20
  model = AutoModelForCausalLM.from_pretrained(
21
  "shisa-ai/shisa-v1-qwen2-7b", quantization_config=quantization_config)
22
  tok = AutoTokenizer.from_pretrained("shisa-ai/shisa-v1-qwen2-7b")
23
- terminators = [
24
- tok.eos_token_id,
25
- tok.convert_tokens_to_ids("<|eot_id|>")
26
- ]
27
 
28
  if torch.cuda.is_available():
29
  device = torch.device("cuda")
@@ -55,7 +55,7 @@ def chat(message, history, temperature,do_sample, max_tokens):
55
  max_new_tokens=max_tokens,
56
  do_sample=True,
57
  temperature=temperature,
58
- eos_token_id=terminators,
59
  )
60
 
61
  if temperature == 0:
 
20
  model = AutoModelForCausalLM.from_pretrained(
21
  "shisa-ai/shisa-v1-qwen2-7b", quantization_config=quantization_config)
22
  tok = AutoTokenizer.from_pretrained("shisa-ai/shisa-v1-qwen2-7b")
23
+ #terminators = [
24
+ # tok.eos_token_id,
25
+ # tok.convert_tokens_to_ids("<|eot_id|>")
26
+ #]
27
 
28
  if torch.cuda.is_available():
29
  device = torch.device("cuda")
 
55
  max_new_tokens=max_tokens,
56
  do_sample=True,
57
  temperature=temperature,
58
+ eos_token_id=tok.eos_token_id, # terminatorsをeos_token_idに変更
59
  )
60
 
61
  if temperature == 0: