OSU-NLP-Group / HippoRAG

HippoRAG is a novel RAG framework inspired by human long-term memory that enables LLMs to continuously integrate knowledge across external documents.
https://arxiv.org/abs/2405.14831
MIT License
902 stars 73 forks source link

fail to call the method "encode_text" #31

Open Jijun-Shi opened 6 days ago

Jijun-Shi commented 6 days ago

the retrieve in bash config is colbert by default. when call the fucntion "init_embedding_model" ,it will return None, So, it fail to call the method "encode_text"

yhshu commented 6 days ago

Hello, which script are you running? If it's the ircot one (Retrieval - ColBERTv2), please pull the latest code and try again.

Jijun-Shi commented 5 days ago

Hello, which script are you running? If it's the ircot one (Retrieval - ColBERTv2), please pull the latest code and try again.

hi, I can run the following script(for Indexing) successfully !

bash src/setup_hipporag_colbert.sh $DATA $LLM $GPUS $SYNONYM_THRESH $LLM_API

but fail to run the script "python3 src/ircot_hipporag.py"(for retrieving)and I find when I call function “init_embedding_model” in /HippoRAG-main/src/lm_wrapper/util.py, the funciton will return None. Then, the code execute the function "load_node_vectors" in hipporag.py, it will report a error. So, Can I build a new Class for loading some other model to repalce the GritWrapper or HuggingFaceWrapper?

yhshu commented 5 days ago

This is a known issue and I think the newest commit has fixed this: https://github.com/OSU-NLP-Group/HippoRAG/blob/026514a77d4a761d91e4b1c9525329e670bd1cb1/src/hipporag.py#L475

Could you check if you're using this version and still have this problem?

Jijun-Shi commented 4 days ago

ok, but it meet the following mistakes when i run the retrieve.sh 1.[Errno 2] No such file or directory: 'data/lm_vectors/colbert/sample/corpus/indexes/nbits_2/centroids.pt' the following is all script which I run:

DATA=sample LLM=gpt-4-1106-preview SYNONYM_THRESH=0.8 GPUS=0,1,2,3 LLM_API=openai

bash src/setup_hipporag_colbert.sh $DATA $LLM $GPUS $SYNONYM_THRESH $LLM_API

python3 src/ircot_hipporag.py --dataset $DATA --retriever $RETRIEVER --llm $LLM_API --llm_model $LLM --max_steps 1 --doc_ensemble f --top_k 10 --sim_threshold $SYNONYM_THRESH --damping 0.5

yhshu commented 4 days ago

Thanks for your response. I have submitted a PR and it should fix this problem after merging: https://github.com/OSU-NLP-Group/HippoRAG/pull/32