Fawaz0ibra commited on
Commit
d58f466
·
verified ·
1 Parent(s): 933c4ee

Update chain_setup.py

Browse files
Files changed (1) hide show
  1. chain_setup.py +9 -8
chain_setup.py CHANGED
@@ -14,15 +14,16 @@ def load_llm():
14
  local_dir_use_symlinks=False
15
  )
16
 
 
17
  llm = LlamaCpp(
18
- model_path=model_file,
19
- flash_attn=False,
20
- n_ctx=2048,
21
- n_batch=512,
22
- chat_format="chatml",
23
- grammar="" # set grammar to an empty string to bypass template parsing issues
24
- )
25
-
26
  return llm
27
 
28
  def build_conversational_chain(vectorstore):
 
14
  local_dir_use_symlinks=False
15
  )
16
 
17
+ # Pass an empty grammar file to bypass Jinja template parsing.
18
  llm = LlamaCpp(
19
+ model_path=model_file,
20
+ flash_attn=False,
21
+ n_ctx=2048,
22
+ n_batch=512,
23
+ chat_format="chatml",
24
+ grammar_path="empty.jinja" # ensure this file exists and is empty
25
+ )
26
+
27
  return llm
28
 
29
  def build_conversational_chain(vectorstore):