Shell script run_retrieve.sh for non-LLM
gneration queries (returns only chunks), track development notes and README.
This commit is contained in:
parent
d034fdaad0
commit
eb9997326f
4 changed files with 1089 additions and 20 deletions
29
run_retrieve.sh
Executable file
29
run_retrieve.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
# This shell script will handle I/O for the python query engine
|
||||
# It will take a query and return the formatted results
|
||||
|
||||
# E.M.F. August 2025
|
||||
|
||||
# Usage: ./run_query.sh
|
||||
|
||||
QUERY_SCRIPT="retrieve.py"
|
||||
|
||||
echo -e "$QUERY_SCRIPT -- retrieve vector store chunks based on similaity + BM25 with reranking.\n"
|
||||
|
||||
# Loop until input is "exit"
|
||||
while true; do
|
||||
read -p "Enter your query (or type 'exit' to quit): " query
|
||||
if [ "$query" == "exit" ] || [ "$query" == "quit" ] || [ "$query" == "" ] ; then
|
||||
echo "Exiting..."
|
||||
break
|
||||
fi
|
||||
time_start=$(date +%s)
|
||||
|
||||
# Call the python script with the query and format the output
|
||||
python3 $QUERY_SCRIPT --query "$query" | \
|
||||
expand | sed -E 's|(.* )(.*/data)|\1./data|' | fold -s -w 131
|
||||
|
||||
time_end=$(date +%s)
|
||||
elapsed=$((time_end - time_start))
|
||||
echo -e "Query processed in $elapsed seconds.\n"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue