Spaces:
Sleeping
Sleeping
Commit ·
0c24ea3
1
Parent(s): 5db4e74
expand query factor changed
Browse files
server/__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/server/__pycache__/main.cpython-310.pyc and b/server/__pycache__/main.cpython-310.pyc differ
|
|
|
server/data/vector_store/chroma.sqlite3
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 18223104
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:79d8716bdd9a6ff37cde113f88263f3c055ee513875da56dc02061c6aec03bcc
|
| 3 |
size 18223104
|
server/main.py
CHANGED
|
@@ -35,8 +35,7 @@ else:
|
|
| 35 |
DB_DIR = Path(__file__).resolve().parent / "data"
|
| 36 |
LOGS_DIR = DB_DIR
|
| 37 |
|
| 38 |
-
|
| 39 |
-
CACHE_FILE = CURRENT_FILE_DIR / "data" / "bm25_index.pkl"
|
| 40 |
LOGS_FILE = LOGS_DIR / "all_chats.csv"
|
| 41 |
|
| 42 |
@asynccontextmanager
|
|
@@ -132,6 +131,7 @@ def main_chat(query,fast_llm,heavy_llm,vector_retriever,bm25_retriever,chunks_di
|
|
| 132 |
return "I didn't quite understand that intent. Could you rephrase your question about MANIT?"
|
| 133 |
|
| 134 |
def add_logs_to_csv(query:str, answer:str):
|
|
|
|
| 135 |
with open(LOGS_FILE,mode='a',encoding='utf-8',newline='') as f:
|
| 136 |
writer= csv.writer(f)
|
| 137 |
writer.writerow([datetime.now(),query,answer])
|
|
|
|
| 35 |
DB_DIR = Path(__file__).resolve().parent / "data"
|
| 36 |
LOGS_DIR = DB_DIR
|
| 37 |
|
| 38 |
+
CACHE_FILE = DB_DIR / "bm25_index.pkl"
|
|
|
|
| 39 |
LOGS_FILE = LOGS_DIR / "all_chats.csv"
|
| 40 |
|
| 41 |
@asynccontextmanager
|
|
|
|
| 131 |
return "I didn't quite understand that intent. Could you rephrase your question about MANIT?"
|
| 132 |
|
| 133 |
def add_logs_to_csv(query:str, answer:str):
|
| 134 |
+
LOGS_FILE.parent.mkdir(parents=True, exist_ok=True)
|
| 135 |
with open(LOGS_FILE,mode='a',encoding='utf-8',newline='') as f:
|
| 136 |
writer= csv.writer(f)
|
| 137 |
writer.writerow([datetime.now(),query,answer])
|
server/utils/ExpandQuery.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from langchain_core.messages import HumanMessage, SystemMessage
|
| 2 |
|
| 3 |
-
def expand_query(query,llm,factor=
|
| 4 |
system_instruction= f"""
|
| 5 |
You are an expert academic search optimization assistant for a college RAG database.
|
| 6 |
Your job is to rewrite the user's input query into {factor} different, keyword-rich search variations.
|
|
|
|
| 1 |
from langchain_core.messages import HumanMessage, SystemMessage
|
| 2 |
|
| 3 |
+
def expand_query(query,llm,factor=3):
|
| 4 |
system_instruction= f"""
|
| 5 |
You are an expert academic search optimization assistant for a college RAG database.
|
| 6 |
Your job is to rewrite the user's input query into {factor} different, keyword-rich search variations.
|