Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,17 @@ from langchain.chains import LLMChain
|
|
| 10 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 11 |
from langchain.schema import Document
|
| 12 |
print("start2")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
from llama_cpp import Llama
|
| 14 |
print("start3")
|
| 15 |
import warnings
|
|
|
|
| 10 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 11 |
from langchain.schema import Document
|
| 12 |
print("start2")
|
| 13 |
+
|
| 14 |
+
wheel_file = "llama_cpp_python-0.3.4-cp310-cp310-win_amd64.whl"
|
| 15 |
+
|
| 16 |
+
# Check if already installed to avoid reinstalling
|
| 17 |
+
try:
|
| 18 |
+
import llama_cpp
|
| 19 |
+
print("llama_cpp already installed.")
|
| 20 |
+
except ImportError:
|
| 21 |
+
print("Installing llama_cpp from wheel...")
|
| 22 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", wheel_file])
|
| 23 |
+
|
| 24 |
from llama_cpp import Llama
|
| 25 |
print("start3")
|
| 26 |
import warnings
|