Spaces:
Running
Running
izammohammed
commited on
Commit
•
ccae188
1
Parent(s):
a093d11
Update llama_call.py
Browse files- 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 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
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(
|