Spaces:
Sleeping
Sleeping
Pulkit-bristol
commited on
Commit
·
91b597b
1
Parent(s):
8aa0b4b
second try
Browse files
agent/__pycache__/agent_1.cpython-312.pyc
CHANGED
Binary files a/agent/__pycache__/agent_1.cpython-312.pyc and b/agent/__pycache__/agent_1.cpython-312.pyc differ
|
|
agent/agent_1.py
CHANGED
@@ -25,7 +25,7 @@ from sklearn.metrics.pairwise import cosine_similarity
|
|
25 |
load_dotenv()
|
26 |
|
27 |
# Load QA pairs and compute embeddings once
|
28 |
-
qa_df = pd.read_csv("
|
29 |
embeddings_model = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
30 |
qa_embeddings = embeddings_model.embed_documents(qa_df["question"].tolist())
|
31 |
|
@@ -143,7 +143,7 @@ def qa_reference(query: str) -> str:
|
|
143 |
top_idx = int(np.argmax(sims))
|
144 |
return f"Similar question: {qa_df.question[top_idx]}\nAnswer: {qa_df.answer[top_idx]}"
|
145 |
|
146 |
-
with open("system_prompt.txt", "r", encoding="utf-8") as f:
|
147 |
system_prompt = f.read()
|
148 |
|
149 |
sys_msg = SystemMessage(content=system_prompt)
|
|
|
25 |
load_dotenv()
|
26 |
|
27 |
# Load QA pairs and compute embeddings once
|
28 |
+
qa_df = pd.read_csv("statics/qa_pairs.csv")
|
29 |
embeddings_model = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
30 |
qa_embeddings = embeddings_model.embed_documents(qa_df["question"].tolist())
|
31 |
|
|
|
143 |
top_idx = int(np.argmax(sims))
|
144 |
return f"Similar question: {qa_df.question[top_idx]}\nAnswer: {qa_df.answer[top_idx]}"
|
145 |
|
146 |
+
with open("statics/system_prompt.txt", "r", encoding="utf-8") as f:
|
147 |
system_prompt = f.read()
|
148 |
|
149 |
sys_msg = SystemMessage(content=system_prompt)
|