Update app.py
Browse files
app.py
CHANGED
@@ -22,9 +22,9 @@ client = InferenceClient(model)
|
|
22 |
|
23 |
folder = snapshot_download(repo_id="umaiku/faiss_index", repo_type="dataset", local_dir=os.getcwd())
|
24 |
|
25 |
-
embeddings = HuggingFaceEmbeddings(model_name="
|
26 |
|
27 |
-
vector_db = FAISS.load_local("
|
28 |
|
29 |
df = pd.read_csv("faiss_index/bger_cedh_db 1954-2024.csv")
|
30 |
|
@@ -65,9 +65,7 @@ def respond(
|
|
65 |
|
66 |
#print("# Case number: " + doc.metadata["case_nb"] + spacer)
|
67 |
#print("# Case url: " + doc.metadata["case_url"] + spacer)
|
68 |
-
|
69 |
-
context = df.iloc[11341].case_text
|
70 |
-
|
71 |
message = f"""
|
72 |
A user is asking you the following question: {message}
|
73 |
Please answer the user in the same language that he used in his question using ONLY the following given context not any prior knowledge or information found on the internet.
|
|
|
22 |
|
23 |
folder = snapshot_download(repo_id="umaiku/faiss_index", repo_type="dataset", local_dir=os.getcwd())
|
24 |
|
25 |
+
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
|
26 |
|
27 |
+
vector_db = FAISS.load_local("faiss_index_mpnet", embeddings, allow_dangerous_deserialization=True)
|
28 |
|
29 |
df = pd.read_csv("faiss_index/bger_cedh_db 1954-2024.csv")
|
30 |
|
|
|
65 |
|
66 |
#print("# Case number: " + doc.metadata["case_nb"] + spacer)
|
67 |
#print("# Case url: " + doc.metadata["case_url"] + spacer)
|
68 |
+
|
|
|
|
|
69 |
message = f"""
|
70 |
A user is asking you the following question: {message}
|
71 |
Please answer the user in the same language that he used in his question using ONLY the following given context not any prior knowledge or information found on the internet.
|