Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,5 @@
|
|
| 1 |
-
import subprocess
|
| 2 |
-
import gradio as gr
|
| 3 |
-
import logging
|
| 4 |
-
import sys
|
| 5 |
-
from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext
|
| 6 |
-
from llama_index.llms import LlamaCPP
|
| 7 |
-
from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt
|
| 8 |
-
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
| 9 |
-
from llama_index.embeddings import LangchainEmbedding
|
| 10 |
|
| 11 |
-
|
| 12 |
subprocess.run(["/usr/local/bin/python", "-m", "pip", "install", "--upgrade", "sentence-transformers"])
|
| 13 |
subprocess.run(["pip", "install", "sentence-transformers"])
|
| 14 |
subprocess.run(["pip", "install", "langchain"])
|
|
@@ -17,6 +8,15 @@ subprocess.run(["pip", "install", "-q", "python-dotenv"])
|
|
| 17 |
subprocess.run(["pip", "install", "-q", "transformers"])
|
| 18 |
subprocess.run(["pip", "install", "llama-cpp-python", "--no-cache-dir", "--install-option", "--CMAKE_ARGS=-DLLAMA_CUBLAS=on", "--install-option", "--FORCE_CMAKE=1"])
|
| 19 |
subprocess.run(["pip", "install", "-q", "llama-index"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Set up logging
|
| 22 |
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
import subprocess
|
| 3 |
subprocess.run(["/usr/local/bin/python", "-m", "pip", "install", "--upgrade", "sentence-transformers"])
|
| 4 |
subprocess.run(["pip", "install", "sentence-transformers"])
|
| 5 |
subprocess.run(["pip", "install", "langchain"])
|
|
|
|
| 8 |
subprocess.run(["pip", "install", "-q", "transformers"])
|
| 9 |
subprocess.run(["pip", "install", "llama-cpp-python", "--no-cache-dir", "--install-option", "--CMAKE_ARGS=-DLLAMA_CUBLAS=on", "--install-option", "--FORCE_CMAKE=1"])
|
| 10 |
subprocess.run(["pip", "install", "-q", "llama-index"])
|
| 11 |
+
import subprocess
|
| 12 |
+
import gradio as gr
|
| 13 |
+
import logging
|
| 14 |
+
import sys
|
| 15 |
+
from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext
|
| 16 |
+
from llama_index.llms import LlamaCPP
|
| 17 |
+
from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt
|
| 18 |
+
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
| 19 |
+
from llama_index.embeddings import LangchainEmbedding
|
| 20 |
|
| 21 |
# Set up logging
|
| 22 |
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|