izammohammed commited on
Commit
ccae188
1 Parent(s): a093d11

Update llama_call.py

Browse files
Files changed (1) hide show
  1. llama_call.py +10 -6
llama_call.py CHANGED
@@ -27,12 +27,16 @@ PROMPT = PromptTemplate(
27
  chain_type_kwargs = {"prompt": PROMPT}
28
 
29
  current_dir = os.getcwd()
30
- llm = CTransformers(
31
- model=os.path.join(current_dir, "saved_models/llama-2-7b-chat.ggmlv3.q4_0.bin"),
32
- model_type="llama",
33
- streaming=True,
34
- config={"max_new_tokens": 256, "temperature": 0.6, "context_length": -1},
35
- )
 
 
 
 
36
 
37
 
38
  qa = RetrievalQA.from_chain_type(
 
27
  chain_type_kwargs = {"prompt": PROMPT}
28
 
29
  current_dir = os.getcwd()
30
+ def load_llm():
31
+ llm = CTransformers(
32
+ model="TheBloke/Llama-2-7B-Chat-GGML",
33
+ model_type="llama",
34
+ max_new_tokens=512,
35
+ temperature=0.5
36
+ )
37
+ return llm
38
+
39
+ llm = load_llm()
40
 
41
 
42
  qa = RetrievalQA.from_chain_type(