Spaces:
Sleeping
Sleeping
Commit
·
b80eb73
1
Parent(s):
ce33049
Update src/backend/chatbot.py
Browse files- src/backend/chatbot.py +6 -1
src/backend/chatbot.py
CHANGED
@@ -18,7 +18,7 @@ from llama_index.llms.llama_utils import (
|
|
18 |
messages_to_prompt,
|
19 |
completion_to_prompt,
|
20 |
)
|
21 |
-
|
22 |
|
23 |
# set version
|
24 |
# st.session_state.demo_lite = False
|
@@ -33,6 +33,11 @@ print("BP 4 ")
|
|
33 |
def init_llm(model, demo_lite):
|
34 |
# st.write("BP 4.1: model: ", model)
|
35 |
if demo_lite == False:
|
|
|
|
|
|
|
|
|
|
|
36 |
print("BP 5 : running full demo")
|
37 |
if model == "Llama2-7b_CPP":
|
38 |
model_path = "src/models/llama-2-7b-chat.Q4_K_M.gguf"
|
|
|
18 |
messages_to_prompt,
|
19 |
completion_to_prompt,
|
20 |
)
|
21 |
+
import subprocess
|
22 |
|
23 |
# set version
|
24 |
# st.session_state.demo_lite = False
|
|
|
33 |
def init_llm(model, demo_lite):
|
34 |
# st.write("BP 4.1: model: ", model)
|
35 |
if demo_lite == False:
|
36 |
+
|
37 |
+
# Set environment variables
|
38 |
+
subprocess.run(['powershell', '$env:FORCE_CMAKE=1'], shell=True)
|
39 |
+
subprocess.run(['powershell', '$env:CMAKE_ARGS="-DLLAMA_CUBLAS=on"'], shell=True)
|
40 |
+
|
41 |
print("BP 5 : running full demo")
|
42 |
if model == "Llama2-7b_CPP":
|
43 |
model_path = "src/models/llama-2-7b-chat.Q4_K_M.gguf"
|