Spaces:
Runtime error
Runtime error
Commit ·
0c24ea3
1
Parent(s): 5db4e74
expand query factor changed
Browse filesFiles changed (4)
123version https://git-lfs.github.com/spec/v1oid sha256:d81532131ff19b3083aa299445fb4fdb4971b083f243ea667d9280739775bbf4size 18223104123version https://git-lfs.github.com/spec/v1oid sha256:79d8716bdd9a6ff37cde113f88263f3c055ee513875da56dc02061c6aec03bccsize 18223104
34 unmodified lines353637383940414289 unmodified lines13213313413513613734 unmodified linesDB_DIR = Path(__file__).resolve().parent / "data"LOGS_DIR = DB_DIRCURRENT_FILE_DIR = Path(__file__).resolve().parentCACHE_FILE = CURRENT_FILE_DIR / "data" / "bm25_index.pkl"LOGS_FILE = LOGS_DIR / "all_chats.csv"@asynccontextmanager89 unmodified linesreturn "I didn't quite understand that intent. Could you rephrase your question about MANIT?"def add_logs_to_csv(query:str, answer:str):with open(LOGS_FILE,mode='a',encoding='utf-8',newline='') as f:writer= csv.writer(f)writer.writerow([datetime.now(),query,answer])34 unmodified lines3536373839404189 unmodified lines13113213313413513613734 unmodified linesDB_DIR = Path(__file__).resolve().parent / "data"LOGS_DIR = DB_DIRCACHE_FILE = DB_DIR / "bm25_index.pkl"LOGS_FILE = LOGS_DIR / "all_chats.csv"@asynccontextmanager89 unmodified linesreturn "I didn't quite understand that intent. Could you rephrase your question about MANIT?"def add_logs_to_csv(query:str, answer:str):LOGS_FILE.parent.mkdir(parents=True, exist_ok=True)with open(LOGS_FILE,mode='a',encoding='utf-8',newline='') as f:writer= csv.writer(f)writer.writerow([datetime.now(),query,answer])
123456from langchain_core.messages import HumanMessage, SystemMessagedef expand_query(query,llm,factor=2):system_instruction= f"""You are an expert academic search optimization assistant for a college RAG database.Your job is to rewrite the user's input query into {factor} different, keyword-rich search variations.123456from langchain_core.messages import HumanMessage, SystemMessagedef expand_query(query,llm,factor=3):system_instruction= f"""You are an expert academic search optimization assistant for a college RAG database.Your job is to rewrite the user's input query into {factor} different, keyword-rich search variations.
server/__pycache__/main.cpython-310.pyc
server/data/vector_store/chroma.sqlite3+1-1
server/main.py+2-2
server/utils/ExpandQuery.py+1-1