kjozsa commited on
Commit
364ca27
1 Parent(s): 757dddf
Files changed (1) hide show
  1. chat/transformerschat.py +5 -5
chat/transformerschat.py CHANGED
@@ -4,7 +4,7 @@ import os
4
 
5
 
6
  def models():
7
- return ["openhermes-2.5-mistral-7b.Q4_K_M.gguf"]
8
 
9
 
10
  def load():
@@ -38,11 +38,11 @@ def ask(_, system_prompt, pre_prompt, question):
38
  {'role': 'system', 'content': f"{system_prompt} {pre_prompt}", },
39
  {'role': 'user', 'content': f"{question}", },
40
  ]
41
- logger.debug(f"<< openhermes << {messages}")
42
- # inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
43
- inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
44
 
45
  outputs = model.generate(inputs, max_length=200)
46
  answer = tokenizer.batch_decode(outputs)[0]
47
- logger.debug(f">> openhermes >> {answer}")
48
  return answer
 
4
 
5
 
6
  def models():
7
+ return ["mistral-7b-openorca.Q5_K_M.gguf"]
8
 
9
 
10
  def load():
 
38
  {'role': 'system', 'content': f"{system_prompt} {pre_prompt}", },
39
  {'role': 'user', 'content': f"{question}", },
40
  ]
41
+ logger.debug(f"<< transformers << {messages}")
42
+ inputs = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
43
+ # inputs = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
44
 
45
  outputs = model.generate(inputs, max_length=200)
46
  answer = tokenizer.batch_decode(outputs)[0]
47
+ logger.debug(f">> transformers >> {answer}")
48
  return answer