umaiku commited on
Commit
1b8a611
·
verified ·
1 Parent(s): 6045274

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -24,7 +24,7 @@ folder = snapshot_download(repo_id="umaiku/faiss_index", repo_type="dataset", lo
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
 
@@ -95,8 +95,7 @@ def respond(
95
  #print("# Case number: " + doc.metadata["case_nb"] + spacer)
96
  #print("# Case url: " + doc.metadata["case_url"] + spacer)
97
 
98
- system_message += f"""
99
- A user is asking you the following question: {message}
100
  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.
101
  # Context:
102
  The following case extracts have been found in either Swiss Federal Court or European Court of Human Rights cases and could fit the question:
 
24
 
25
  embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
26
 
27
+ vector_db = FAISS.load_local("faiss_index_mpnet_cos", embeddings, allow_dangerous_deserialization=True)
28
 
29
  df = pd.read_csv("faiss_index/bger_cedh_db 1954-2024.csv")
30
 
 
95
  #print("# Case number: " + doc.metadata["case_nb"] + spacer)
96
  #print("# Case url: " + doc.metadata["case_url"] + spacer)
97
 
98
+ system_message += f"""A user is asking you the following question: {message}
 
99
  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.
100
  # Context:
101
  The following case extracts have been found in either Swiss Federal Court or European Court of Human Rights cases and could fit the question: