Spaces:
Runtime error
Runtime error
Update qabot.py
Browse files
qabot.py
CHANGED
|
@@ -29,9 +29,11 @@ model_file = hf_hub_download(
|
|
| 29 |
# Vector store location
|
| 30 |
vector_dp_path = "/home/user/app/vectorstores/db_faiss"
|
| 31 |
|
|
|
|
|
|
|
| 32 |
from prepare_vector_dp import create_dp_from_files
|
| 33 |
#create_db_from_text()
|
| 34 |
-
create_dp_from_files()
|
| 35 |
|
| 36 |
# Load LLM with CTransformers
|
| 37 |
def load_llm(model_file):
|
|
@@ -60,7 +62,7 @@ def create_qa_chain(prompt, llm, db):
|
|
| 60 |
|
| 61 |
# Load vector DB
|
| 62 |
def read_vector_db():
|
| 63 |
-
embedding_model = HuggingFaceEmbeddings(model_name =
|
| 64 |
return FAISS.load_local(vector_dp_path, embedding_model, allow_dangerous_deserialization=True)
|
| 65 |
|
| 66 |
# Build everything
|
|
|
|
| 29 |
# Vector store location
|
| 30 |
vector_dp_path = "/home/user/app/vectorstores/db_faiss"
|
| 31 |
|
| 32 |
+
request_model = "sentence-transformers/distiluse-base-multilingual-cased-v1"
|
| 33 |
+
|
| 34 |
from prepare_vector_dp import create_dp_from_files
|
| 35 |
#create_db_from_text()
|
| 36 |
+
create_dp_from_files(request_model)
|
| 37 |
|
| 38 |
# Load LLM with CTransformers
|
| 39 |
def load_llm(model_file):
|
|
|
|
| 62 |
|
| 63 |
# Load vector DB
|
| 64 |
def read_vector_db():
|
| 65 |
+
embedding_model = HuggingFaceEmbeddings(model_name = request_model)
|
| 66 |
return FAISS.load_local(vector_dp_path, embedding_model, allow_dangerous_deserialization=True)
|
| 67 |
|
| 68 |
# Build everything
|