AutoRAG 0.3.16__tar.gz → 0.3.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/PKG-INFO +6 -5
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/SOURCES.txt +14 -5
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/requires.txt +5 -4
- {autorag-0.3.16 → autorag-0.3.18}/PKG-INFO +6 -5
- autorag-0.3.18/autorag/VERSION +1 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/base.py +2 -2
- {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/api.py +12 -2
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluator.py +65 -66
- {autorag-0.3.16 → autorag-0.3.18}/autorag/node_line.py +0 -8
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/vllm.py +31 -10
- {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/__init__.py +0 -2
- autorag-0.3.18/autorag/nodes/hybridretrieval/base.py +58 -0
- {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/hybrid_cc.py +46 -33
- {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/hybrid_rrf.py +53 -32
- autorag-0.3.18/autorag/nodes/hybridretrieval/run.py +137 -0
- autorag-0.3.18/autorag/nodes/lexicalretrieval/__init__.py +1 -0
- {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/lexicalretrieval}/bm25.py +7 -1
- autorag-0.3.18/autorag/nodes/lexicalretrieval/run.py +148 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/base.py +2 -6
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/run.py +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/base.py +6 -11
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/base.py +8 -18
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/run.py +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/base.py +8 -19
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/cohere.py +0 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/run.py +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/__init__.py +9 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/base.py +3 -5
- autorag-0.3.18/autorag/nodes/promptmaker/chat_fstring.py +73 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/run.py +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/run.py +35 -3
- autorag-0.3.18/autorag/nodes/retrieval/__init__.py +0 -0
- autorag-0.3.18/autorag/nodes/retrieval/run_util.py +152 -0
- autorag-0.3.18/autorag/nodes/semanticretrieval/__init__.py +1 -0
- autorag-0.3.18/autorag/nodes/semanticretrieval/run.py +148 -0
- {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/semanticretrieval}/vectordb.py +38 -2
- {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/node.py +2 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/support.py +30 -9
- autorag-0.3.18/autorag/utils/cast.py +45 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/util.py +9 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/base.py +7 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/chroma.py +3 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/couchbase.py +21 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/milvus.py +3 -2
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/pinecone.py +3 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/qdrant.py +3 -1
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/weaviate.py +17 -0
- {autorag-0.3.16 → autorag-0.3.18}/pyproject.toml +8 -4
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/compact_local.yaml +12 -2
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/compact_openai.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/full.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/half.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/compact.yaml +16 -2
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/full.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/half.yaml +15 -1
- autorag-0.3.16/sample_config/rag/english/non_gpu/half.yaml → autorag-0.3.18/sample_config/rag/english/non_gpu/compact.yaml +15 -13
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/full.yaml +16 -3
- autorag-0.3.18/sample_config/rag/english/non_gpu/half.yaml +109 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_bedrock.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_local.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_ollama.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_openai.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/extracted_sample.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/full.yaml +16 -2
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/compact_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/full_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/half_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/compact_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/full_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/half_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/compact_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/full_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/half_korean.yaml +15 -1
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/simple_korean.yaml +1 -1
- {autorag-0.3.16 → autorag-0.3.18}/uv.lock +1523 -455
- autorag-0.3.16/autorag/VERSION +0 -1
- autorag-0.3.16/autorag/nodes/retrieval/run.py +0 -544
- autorag-0.3.16/sample_config/rag/english/non_gpu/compact.yaml +0 -83
- {autorag-0.3.16 → autorag-0.3.18}/.dockerignore +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/.gitignore +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/dependency_links.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/entry_points.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/top_level.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/Dockerfile.base +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/Dockerfile.gpu +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/chunker.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/cli.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/dashboard.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/langchain_chunk.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/llama_index_chunk.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/run.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/langchain.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/llama_index.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/llama_index.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/llama_index_default_prompt.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/ragas.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/simple.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/clova.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/langchain_parse.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/llamaparse.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/run.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/table_hybrid_parse.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/llama_index_query_evolve.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/openai_query_evolve.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/prompt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/extract_evidence.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/dontknow.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/passage_dependency.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/prompt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/llama_index_gen_gt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/openai_gen_gt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/prompt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/llama_gen_query.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/openai_gen_query.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/prompt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/sample.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/schema.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/utils/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/data/utils/util.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/gradio.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/swagger.yml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/embedding/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/embedding/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/generation.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/deepeval_prompt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/coh_detailed.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/con_detailed.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/flu_detailed.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/rel_detailed.txt +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/generation.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/retrieval.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/retrieval_contents.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/util.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/retrieval.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/retrieval_contents.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/util.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/llama_index_llm.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/openai_llm.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/run.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/vllm_api.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/pass_passage_augmenter.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/prev_next_augmenter.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/longllmlingua.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/pass_compressor.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/refine.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/run.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/tree_summarize.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/pass_passage_filter.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/percentile_cutoff.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/recency.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/similarity_percentile_cutoff.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/similarity_threshold_cutoff.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/threshold_cutoff.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/colbert.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flag_embedding.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flag_embedding_llm.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flashrank.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/jina.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/koreranker.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/mixedbreadai.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/monot5.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/openvino.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/pass_reranker.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/rankgpt.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/sentence_transformer.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/modeling_enc_t5.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/tart.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/tokenization_enc_t5.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/time_reranker.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/upr.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/voyageai.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/fstring.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/long_context_reorder.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/window_replacement.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/hyde.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/multi_query_expansion.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/pass_query_expansion.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/query_decompose.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/retrieval/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/util.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/parser.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/base.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/metricinput.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/module.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/strategy.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/preprocess.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/validator.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/__init__.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/autorag/web.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/build_and_push.sh +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/docker-compose.yml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/chunk_full.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/chunk_ko.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/simple_chunk.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/all_files_full.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/file_types_full.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_hybird.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_ko.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_multimodal.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_ocr.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/simple_parse.yaml +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/README.md +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/eli5/load_eli5_dataset.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/hotpotqa/load_hotpotqa_dataset.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/msmarco/load_msmarco_dataset.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/triviaqa/load_triviaqa_dataset.py +0 -0
- {autorag-0.3.16 → autorag-0.3.18}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AutoRAG
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.18
|
|
4
4
|
Summary: Automatically Evaluate RAG pipelines with your own data. Find optimal structure for new RAG product.
|
|
5
5
|
Author-email: Marker-Inc <vkehfdl1@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/Marker-Inc-Korea/AutoRAG
|
|
@@ -16,7 +16,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
16
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
|
-
Requires-Dist: pydantic
|
|
19
|
+
Requires-Dist: pydantic>=2.9.2
|
|
20
20
|
Requires-Dist: numpy==1.26.4
|
|
21
21
|
Requires-Dist: pandas>=2.2.3
|
|
22
22
|
Requires-Dist: tqdm>=4.67.1
|
|
@@ -31,8 +31,8 @@ Requires-Dist: evaluate>=0.4.4
|
|
|
31
31
|
Requires-Dist: rouge_score>=0.1.2
|
|
32
32
|
Requires-Dist: rich>=14.0.0
|
|
33
33
|
Requires-Dist: click>=8.2.1
|
|
34
|
-
Requires-Dist: cohere>=5.
|
|
35
|
-
Requires-Dist: tokenlog>=0.0.
|
|
34
|
+
Requires-Dist: cohere>=5.18.0
|
|
35
|
+
Requires-Dist: tokenlog>=0.0.3
|
|
36
36
|
Requires-Dist: aiohttp>=3.12.13
|
|
37
37
|
Requires-Dist: voyageai>=0.3.2
|
|
38
38
|
Requires-Dist: mixedbread-ai>=2.2.6
|
|
@@ -44,6 +44,8 @@ Requires-Dist: grpcio<1.68.0,>=1.66.2
|
|
|
44
44
|
Requires-Dist: grpcio-health-checking<1.68.0,>=1.66.2
|
|
45
45
|
Requires-Dist: grpcio-status<1.68.0,>=1.66.2
|
|
46
46
|
Requires-Dist: grpcio-tools<1.68.0,>=1.66.2
|
|
47
|
+
Requires-Dist: datasets>=3.5.1
|
|
48
|
+
Requires-Dist: pyarrow>=20.0.0
|
|
47
49
|
Requires-Dist: pymilvus>=2.6.0b0
|
|
48
50
|
Requires-Dist: chromadb>=1.0.0
|
|
49
51
|
Requires-Dist: weaviate-client>=4.15.2
|
|
@@ -92,7 +94,6 @@ Provides-Extra: gpu
|
|
|
92
94
|
Requires-Dist: torch>=2.7.1; extra == "gpu"
|
|
93
95
|
Requires-Dist: sentencepiece>=0.2.0; extra == "gpu"
|
|
94
96
|
Requires-Dist: bert_score>=0.3.13; extra == "gpu"
|
|
95
|
-
Requires-Dist: optimum[nncf,openvino]>=1.26.1; extra == "gpu"
|
|
96
97
|
Requires-Dist: peft>=0.15.2; extra == "gpu"
|
|
97
98
|
Requires-Dist: llmlingua>=0.2.2; extra == "gpu"
|
|
98
99
|
Requires-Dist: FlagEmbedding>=1.2.11; extra == "gpu"
|
|
@@ -101,6 +101,14 @@ autorag/nodes/generator/openai_llm.py
|
|
|
101
101
|
autorag/nodes/generator/run.py
|
|
102
102
|
autorag/nodes/generator/vllm.py
|
|
103
103
|
autorag/nodes/generator/vllm_api.py
|
|
104
|
+
autorag/nodes/hybridretrieval/__init__.py
|
|
105
|
+
autorag/nodes/hybridretrieval/base.py
|
|
106
|
+
autorag/nodes/hybridretrieval/hybrid_cc.py
|
|
107
|
+
autorag/nodes/hybridretrieval/hybrid_rrf.py
|
|
108
|
+
autorag/nodes/hybridretrieval/run.py
|
|
109
|
+
autorag/nodes/lexicalretrieval/__init__.py
|
|
110
|
+
autorag/nodes/lexicalretrieval/bm25.py
|
|
111
|
+
autorag/nodes/lexicalretrieval/run.py
|
|
104
112
|
autorag/nodes/passageaugmenter/__init__.py
|
|
105
113
|
autorag/nodes/passageaugmenter/base.py
|
|
106
114
|
autorag/nodes/passageaugmenter/pass_passage_augmenter.py
|
|
@@ -147,6 +155,7 @@ autorag/nodes/passagereranker/tart/tart.py
|
|
|
147
155
|
autorag/nodes/passagereranker/tart/tokenization_enc_t5.py
|
|
148
156
|
autorag/nodes/promptmaker/__init__.py
|
|
149
157
|
autorag/nodes/promptmaker/base.py
|
|
158
|
+
autorag/nodes/promptmaker/chat_fstring.py
|
|
150
159
|
autorag/nodes/promptmaker/fstring.py
|
|
151
160
|
autorag/nodes/promptmaker/long_context_reorder.py
|
|
152
161
|
autorag/nodes/promptmaker/run.py
|
|
@@ -160,17 +169,17 @@ autorag/nodes/queryexpansion/query_decompose.py
|
|
|
160
169
|
autorag/nodes/queryexpansion/run.py
|
|
161
170
|
autorag/nodes/retrieval/__init__.py
|
|
162
171
|
autorag/nodes/retrieval/base.py
|
|
163
|
-
autorag/nodes/retrieval/
|
|
164
|
-
autorag/nodes/
|
|
165
|
-
autorag/nodes/
|
|
166
|
-
autorag/nodes/
|
|
167
|
-
autorag/nodes/retrieval/vectordb.py
|
|
172
|
+
autorag/nodes/retrieval/run_util.py
|
|
173
|
+
autorag/nodes/semanticretrieval/__init__.py
|
|
174
|
+
autorag/nodes/semanticretrieval/run.py
|
|
175
|
+
autorag/nodes/semanticretrieval/vectordb.py
|
|
168
176
|
autorag/schema/__init__.py
|
|
169
177
|
autorag/schema/base.py
|
|
170
178
|
autorag/schema/metricinput.py
|
|
171
179
|
autorag/schema/module.py
|
|
172
180
|
autorag/schema/node.py
|
|
173
181
|
autorag/utils/__init__.py
|
|
182
|
+
autorag/utils/cast.py
|
|
174
183
|
autorag/utils/preprocess.py
|
|
175
184
|
autorag/utils/util.py
|
|
176
185
|
autorag/vectordb/__init__.py
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pydantic
|
|
1
|
+
pydantic>=2.9.2
|
|
2
2
|
numpy==1.26.4
|
|
3
3
|
pandas>=2.2.3
|
|
4
4
|
tqdm>=4.67.1
|
|
@@ -13,8 +13,8 @@ evaluate>=0.4.4
|
|
|
13
13
|
rouge_score>=0.1.2
|
|
14
14
|
rich>=14.0.0
|
|
15
15
|
click>=8.2.1
|
|
16
|
-
cohere>=5.
|
|
17
|
-
tokenlog>=0.0.
|
|
16
|
+
cohere>=5.18.0
|
|
17
|
+
tokenlog>=0.0.3
|
|
18
18
|
aiohttp>=3.12.13
|
|
19
19
|
voyageai>=0.3.2
|
|
20
20
|
mixedbread-ai>=2.2.6
|
|
@@ -26,6 +26,8 @@ grpcio<1.68.0,>=1.66.2
|
|
|
26
26
|
grpcio-health-checking<1.68.0,>=1.66.2
|
|
27
27
|
grpcio-status<1.68.0,>=1.66.2
|
|
28
28
|
grpcio-tools<1.68.0,>=1.66.2
|
|
29
|
+
datasets>=3.5.1
|
|
30
|
+
pyarrow>=20.0.0
|
|
29
31
|
pymilvus>=2.6.0b0
|
|
30
32
|
chromadb>=1.0.0
|
|
31
33
|
weaviate-client>=4.15.2
|
|
@@ -67,7 +69,6 @@ AutoRAG[ja]
|
|
|
67
69
|
torch>=2.7.1
|
|
68
70
|
sentencepiece>=0.2.0
|
|
69
71
|
bert_score>=0.3.13
|
|
70
|
-
optimum[nncf,openvino]>=1.26.1
|
|
71
72
|
peft>=0.15.2
|
|
72
73
|
llmlingua>=0.2.2
|
|
73
74
|
FlagEmbedding>=1.2.11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AutoRAG
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.18
|
|
4
4
|
Summary: Automatically Evaluate RAG pipelines with your own data. Find optimal structure for new RAG product.
|
|
5
5
|
Author-email: Marker-Inc <vkehfdl1@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/Marker-Inc-Korea/AutoRAG
|
|
@@ -16,7 +16,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
16
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
|
-
Requires-Dist: pydantic
|
|
19
|
+
Requires-Dist: pydantic>=2.9.2
|
|
20
20
|
Requires-Dist: numpy==1.26.4
|
|
21
21
|
Requires-Dist: pandas>=2.2.3
|
|
22
22
|
Requires-Dist: tqdm>=4.67.1
|
|
@@ -31,8 +31,8 @@ Requires-Dist: evaluate>=0.4.4
|
|
|
31
31
|
Requires-Dist: rouge_score>=0.1.2
|
|
32
32
|
Requires-Dist: rich>=14.0.0
|
|
33
33
|
Requires-Dist: click>=8.2.1
|
|
34
|
-
Requires-Dist: cohere>=5.
|
|
35
|
-
Requires-Dist: tokenlog>=0.0.
|
|
34
|
+
Requires-Dist: cohere>=5.18.0
|
|
35
|
+
Requires-Dist: tokenlog>=0.0.3
|
|
36
36
|
Requires-Dist: aiohttp>=3.12.13
|
|
37
37
|
Requires-Dist: voyageai>=0.3.2
|
|
38
38
|
Requires-Dist: mixedbread-ai>=2.2.6
|
|
@@ -44,6 +44,8 @@ Requires-Dist: grpcio<1.68.0,>=1.66.2
|
|
|
44
44
|
Requires-Dist: grpcio-health-checking<1.68.0,>=1.66.2
|
|
45
45
|
Requires-Dist: grpcio-status<1.68.0,>=1.66.2
|
|
46
46
|
Requires-Dist: grpcio-tools<1.68.0,>=1.66.2
|
|
47
|
+
Requires-Dist: datasets>=3.5.1
|
|
48
|
+
Requires-Dist: pyarrow>=20.0.0
|
|
47
49
|
Requires-Dist: pymilvus>=2.6.0b0
|
|
48
50
|
Requires-Dist: chromadb>=1.0.0
|
|
49
51
|
Requires-Dist: weaviate-client>=4.15.2
|
|
@@ -92,7 +94,6 @@ Provides-Extra: gpu
|
|
|
92
94
|
Requires-Dist: torch>=2.7.1; extra == "gpu"
|
|
93
95
|
Requires-Dist: sentencepiece>=0.2.0; extra == "gpu"
|
|
94
96
|
Requires-Dist: bert_score>=0.3.13; extra == "gpu"
|
|
95
|
-
Requires-Dist: optimum[nncf,openvino]>=1.26.1; extra == "gpu"
|
|
96
97
|
Requires-Dist: peft>=0.15.2; extra == "gpu"
|
|
97
98
|
Requires-Dist: llmlingua>=0.2.2; extra == "gpu"
|
|
98
99
|
Requires-Dist: FlagEmbedding>=1.2.11; extra == "gpu"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.18
|
|
@@ -8,7 +8,7 @@ import pandas as pd
|
|
|
8
8
|
from tqdm import tqdm
|
|
9
9
|
|
|
10
10
|
import autorag
|
|
11
|
-
from autorag.nodes.
|
|
11
|
+
from autorag.nodes.semanticretrieval.vectordb import vectordb_ingest_api, vectordb_pure
|
|
12
12
|
from autorag.utils.util import (
|
|
13
13
|
save_parquet_safe,
|
|
14
14
|
fetch_contents,
|
|
@@ -176,7 +176,7 @@ def make_qa_with_existing_qa(
|
|
|
176
176
|
collection = chroma_client.get_or_create_collection(collection_name)
|
|
177
177
|
|
|
178
178
|
# embed corpus_df
|
|
179
|
-
|
|
179
|
+
vectordb_ingest_api(collection, corpus_df, embeddings)
|
|
180
180
|
query_embeddings = embeddings.get_text_embedding_batch(
|
|
181
181
|
existing_query_df["query"].tolist()
|
|
182
182
|
)
|
|
@@ -248,9 +248,19 @@ class ApiRunner(BaseRunner):
|
|
|
248
248
|
self.app.run(host=host, port=port, **kwargs)
|
|
249
249
|
|
|
250
250
|
def extract_retrieve_passage(self, df: pd.DataFrame) -> List[RetrievedPassage]:
|
|
251
|
-
retrieved_ids
|
|
251
|
+
if "retrieved_ids" not in df.columns and "retrieved_ids_semantic" in df.columns:
|
|
252
|
+
retrieved_ids: List[str] = df["retrieved_ids_semantic"].tolist()[0]
|
|
253
|
+
scores = df["retrieve_scores_semantic"].tolist()[0]
|
|
254
|
+
elif (
|
|
255
|
+
"retrieved_ids" not in df.columns
|
|
256
|
+
and "retrieved_ids_semantic" not in df.columns
|
|
257
|
+
):
|
|
258
|
+
retrieved_ids: List[str] = df["retrieved_ids_lexical"].tolist()[0]
|
|
259
|
+
scores = df["retrieve_scores_lexical"].tolist()[0]
|
|
260
|
+
else:
|
|
261
|
+
retrieved_ids: List[str] = df["retrieved_ids"].tolist()[0]
|
|
262
|
+
scores = df["retrieve_scores"].tolist()[0]
|
|
252
263
|
contents = fetch_contents(self.corpus_df, [retrieved_ids])[0]
|
|
253
|
-
scores = df["retrieve_scores"].tolist()[0]
|
|
254
264
|
if "path" in self.corpus_df.columns:
|
|
255
265
|
paths = fetch_contents(self.corpus_df, [retrieved_ids], column_name="path")[
|
|
256
266
|
0
|
|
@@ -6,18 +6,18 @@ import shutil
|
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from itertools import chain
|
|
8
8
|
from typing import List, Dict, Optional
|
|
9
|
-
from rich.progress import Progress, BarColumn, TimeElapsedColumn
|
|
10
9
|
|
|
11
10
|
import pandas as pd
|
|
12
11
|
import yaml
|
|
13
12
|
|
|
14
13
|
from autorag.node_line import run_node_line
|
|
15
14
|
from autorag.nodes.retrieval.base import get_bm25_pkl_name
|
|
16
|
-
from autorag.nodes.
|
|
17
|
-
from autorag.nodes.
|
|
18
|
-
|
|
15
|
+
from autorag.nodes.lexicalretrieval.bm25 import bm25_ingest
|
|
16
|
+
from autorag.nodes.semanticretrieval.vectordb import (
|
|
17
|
+
vectordb_ingest_api,
|
|
19
18
|
filter_exist_ids,
|
|
20
19
|
filter_exist_ids_from_retrieval_gt,
|
|
20
|
+
vectordb_ingest_huggingface,
|
|
21
21
|
)
|
|
22
22
|
from autorag.schema import Node
|
|
23
23
|
from autorag.schema.node import (
|
|
@@ -104,7 +104,10 @@ class Evaluator:
|
|
|
104
104
|
self.corpus_data.to_parquet(corpus_path_in_project, index=False)
|
|
105
105
|
|
|
106
106
|
def start_trial(
|
|
107
|
-
self,
|
|
107
|
+
self,
|
|
108
|
+
yaml_path: str,
|
|
109
|
+
skip_validation: bool = False,
|
|
110
|
+
full_ingest: bool = True,
|
|
108
111
|
):
|
|
109
112
|
"""
|
|
110
113
|
Start AutoRAG trial.
|
|
@@ -158,64 +161,62 @@ class Evaluator:
|
|
|
158
161
|
node_lines = self._load_node_lines(yaml_path)
|
|
159
162
|
self.__ingest_bm25_full(node_lines)
|
|
160
163
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
) as progress:
|
|
168
|
-
# Ingest VectorDB corpus
|
|
169
|
-
if any(
|
|
170
|
-
list(
|
|
171
|
-
map(
|
|
172
|
-
lambda nodes: module_type_exists(nodes, "vectordb"),
|
|
173
|
-
node_lines.values(),
|
|
174
|
-
)
|
|
164
|
+
# Ingest VectorDB corpus
|
|
165
|
+
if any(
|
|
166
|
+
list(
|
|
167
|
+
map(
|
|
168
|
+
lambda nodes: module_type_exists(nodes, "vectordb"),
|
|
169
|
+
node_lines.values(),
|
|
175
170
|
)
|
|
176
|
-
):
|
|
177
|
-
task_ingest = progress.add_task("[cyan]Ingesting VectorDB...", total=1)
|
|
178
|
-
|
|
179
|
-
loop = get_event_loop()
|
|
180
|
-
loop.run_until_complete(self.__ingest_vectordb(yaml_path, full_ingest))
|
|
181
|
-
|
|
182
|
-
progress.update(task_ingest, completed=1)
|
|
183
|
-
|
|
184
|
-
trial_summary_df = pd.DataFrame(
|
|
185
|
-
columns=[
|
|
186
|
-
"node_line_name",
|
|
187
|
-
"node_type",
|
|
188
|
-
"best_module_filename",
|
|
189
|
-
"best_module_name",
|
|
190
|
-
"best_module_params",
|
|
191
|
-
"best_execution_time",
|
|
192
|
-
]
|
|
193
|
-
)
|
|
194
|
-
task_eval = progress.add_task(
|
|
195
|
-
"[cyan]Evaluating...", total=sum(map(len, node_lines.values()))
|
|
196
171
|
)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if i == 0:
|
|
204
|
-
previous_result = self.qa_data
|
|
205
|
-
logger.info(f"Running node line {node_line_name}...")
|
|
206
|
-
previous_result = run_node_line(
|
|
207
|
-
node_line, node_line_dir, previous_result, progress, task_eval
|
|
172
|
+
):
|
|
173
|
+
vectordb_list = load_all_vectordb_from_yaml(yaml_path, self.project_dir)
|
|
174
|
+
for vectordb in vectordb_list:
|
|
175
|
+
loop = get_event_loop()
|
|
176
|
+
target_corpus = loop.run_until_complete(
|
|
177
|
+
self.__get_ingest_target_corpus(vectordb, full_ingest)
|
|
208
178
|
)
|
|
179
|
+
if vectordb.embedding.__class__.class_name() == "HuggingFaceEmbedding":
|
|
180
|
+
vectordb_ingest_huggingface(vectordb, target_corpus)
|
|
181
|
+
else:
|
|
182
|
+
# API Ingest Method
|
|
183
|
+
loop = get_event_loop()
|
|
184
|
+
loop.run_until_complete(
|
|
185
|
+
vectordb_ingest_api(vectordb, target_corpus)
|
|
186
|
+
)
|
|
209
187
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
188
|
+
trial_summary_df = pd.DataFrame(
|
|
189
|
+
columns=[
|
|
190
|
+
"node_line_name",
|
|
191
|
+
"node_type",
|
|
192
|
+
"best_module_filename",
|
|
193
|
+
"best_module_name",
|
|
194
|
+
"best_module_params",
|
|
195
|
+
"best_execution_time",
|
|
196
|
+
]
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
for i, (node_line_name, node_line) in enumerate(node_lines.items()):
|
|
200
|
+
node_line_dir = os.path.join(self.project_dir, trial_name, node_line_name)
|
|
201
|
+
os.makedirs(node_line_dir, exist_ok=False)
|
|
202
|
+
if i == 0:
|
|
203
|
+
previous_result = self.qa_data
|
|
204
|
+
logger.info(f"Running node line {node_line_name}...")
|
|
205
|
+
previous_result = run_node_line(
|
|
206
|
+
node_line,
|
|
207
|
+
node_line_dir,
|
|
208
|
+
previous_result,
|
|
209
|
+
)
|
|
213
210
|
|
|
214
|
-
trial_summary_df.
|
|
215
|
-
|
|
211
|
+
trial_summary_df = self._append_node_line_summary(
|
|
212
|
+
node_line_name, node_line_dir, trial_summary_df
|
|
216
213
|
)
|
|
217
214
|
|
|
218
|
-
|
|
215
|
+
trial_summary_df.to_csv(
|
|
216
|
+
os.path.join(self.project_dir, trial_name, "summary.csv"), index=False
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
logger.info("Evaluation complete.")
|
|
219
220
|
|
|
220
221
|
def __ingest_bm25_full(self, node_lines: Dict[str, List[Node]]):
|
|
221
222
|
if any(
|
|
@@ -544,17 +545,15 @@ class Evaluator:
|
|
|
544
545
|
)
|
|
545
546
|
return list(set(embedding_models_list))
|
|
546
547
|
|
|
547
|
-
async def
|
|
548
|
-
|
|
548
|
+
async def __get_ingest_target_corpus(
|
|
549
|
+
self, vectordb, full_ingest: bool
|
|
550
|
+
) -> pd.DataFrame:
|
|
549
551
|
if full_ingest is True:
|
|
550
552
|
# get the target ingest corpus from the whole corpus
|
|
551
|
-
|
|
552
|
-
target_corpus = await filter_exist_ids(vectordb, self.corpus_data)
|
|
553
|
-
await vectordb_ingest(vectordb, target_corpus)
|
|
553
|
+
target_corpus = await filter_exist_ids(vectordb, self.corpus_data)
|
|
554
554
|
else:
|
|
555
555
|
# get the target ingest corpus from the retrieval gt only
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
await vectordb_ingest(vectordb, target_corpus)
|
|
556
|
+
target_corpus = await filter_exist_ids_from_retrieval_gt(
|
|
557
|
+
vectordb, self.qa_data, self.corpus_data
|
|
558
|
+
)
|
|
559
|
+
return target_corpus
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import pathlib
|
|
3
3
|
from typing import Dict, List, Optional
|
|
4
|
-
from rich.progress import Progress
|
|
5
4
|
|
|
6
5
|
import pandas as pd
|
|
7
6
|
|
|
@@ -26,8 +25,6 @@ def run_node_line(
|
|
|
26
25
|
nodes: List[Node],
|
|
27
26
|
node_line_dir: str,
|
|
28
27
|
previous_result: Optional[pd.DataFrame] = None,
|
|
29
|
-
progress: Progress = None,
|
|
30
|
-
task_eval: Progress.tasks = None,
|
|
31
28
|
):
|
|
32
29
|
"""
|
|
33
30
|
Run the whole node line by running each node.
|
|
@@ -36,8 +33,6 @@ def run_node_line(
|
|
|
36
33
|
:param node_line_dir: This node line's directory.
|
|
37
34
|
:param previous_result: A result of the previous node line.
|
|
38
35
|
If None, it loads qa data from data/qa.parquet.
|
|
39
|
-
:param progress: Rich Progress object.
|
|
40
|
-
:param task_eval: Progress task object
|
|
41
36
|
:return: The final result of the node line.
|
|
42
37
|
"""
|
|
43
38
|
if previous_result is None:
|
|
@@ -63,9 +58,6 @@ def run_node_line(
|
|
|
63
58
|
"best_execution_time": best_node_row["execution_time"].values[0],
|
|
64
59
|
}
|
|
65
60
|
)
|
|
66
|
-
# Update progress for each node
|
|
67
|
-
if progress:
|
|
68
|
-
progress.update(task_eval, advance=1)
|
|
69
61
|
|
|
70
62
|
pd.DataFrame(summary_lst).to_csv(
|
|
71
63
|
os.path.join(node_line_dir, "summary.csv"), index=False
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import gc
|
|
2
2
|
from copy import deepcopy
|
|
3
|
-
from typing import List, Tuple
|
|
3
|
+
from typing import List, Tuple, Union
|
|
4
4
|
|
|
5
5
|
import pandas as pd
|
|
6
6
|
|
|
7
7
|
from autorag.nodes.generator.base import BaseGenerator
|
|
8
8
|
from autorag.utils import result_to_dataframe
|
|
9
|
-
from autorag.utils.util import pop_params, to_list
|
|
9
|
+
from autorag.utils.util import pop_params, to_list, is_chat_prompt
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Vllm(BaseGenerator):
|
|
@@ -47,7 +47,8 @@ class Vllm(BaseGenerator):
|
|
|
47
47
|
|
|
48
48
|
destroy_model_parallel()
|
|
49
49
|
destroy_distributed_environment()
|
|
50
|
-
|
|
50
|
+
if hasattr(self.vllm_model.llm_engine, 'model_executor'):
|
|
51
|
+
del self.vllm_model.llm_engine.model_executor
|
|
51
52
|
del self.vllm_model
|
|
52
53
|
with contextlib.suppress(AssertionError):
|
|
53
54
|
torch.distributed.destroy_process_group()
|
|
@@ -62,10 +63,14 @@ class Vllm(BaseGenerator):
|
|
|
62
63
|
@result_to_dataframe(["generated_texts", "generated_tokens", "generated_log_probs"])
|
|
63
64
|
def pure(self, previous_result: pd.DataFrame, *args, **kwargs):
|
|
64
65
|
prompts = self.cast_to_run(previous_result)
|
|
65
|
-
|
|
66
|
+
thinking = kwargs.pop("thinking", False)
|
|
67
|
+
return self._pure(prompts, thinking=thinking, **kwargs)
|
|
66
68
|
|
|
67
69
|
def _pure(
|
|
68
|
-
self,
|
|
70
|
+
self,
|
|
71
|
+
prompts: Union[List[str], List[List[dict]]],
|
|
72
|
+
thinking: bool = False,
|
|
73
|
+
**kwargs,
|
|
69
74
|
) -> Tuple[List[str], List[List[int]], List[List[float]]]:
|
|
70
75
|
"""
|
|
71
76
|
Vllm module.
|
|
@@ -73,7 +78,11 @@ class Vllm(BaseGenerator):
|
|
|
73
78
|
You can set logprobs to get the log probs of the generated text.
|
|
74
79
|
Default logprobs is 1.
|
|
75
80
|
|
|
76
|
-
:param prompts: A list of prompts.
|
|
81
|
+
:param prompts: A list of prompts or a list of chat prompts.
|
|
82
|
+
:param thinking: A boolean that indicates whether to think when generating text.
|
|
83
|
+
Default is False.
|
|
84
|
+
Effective when set True and using chat prompts.
|
|
85
|
+
You can learn how to use chat prompt at `chat_fstring` module documentation.
|
|
77
86
|
:param kwargs: The extra parameters for generating the text.
|
|
78
87
|
:return: A tuple of three elements.
|
|
79
88
|
The first element is a list of generated text.
|
|
@@ -83,7 +92,7 @@ class Vllm(BaseGenerator):
|
|
|
83
92
|
try:
|
|
84
93
|
from vllm.outputs import RequestOutput
|
|
85
94
|
from vllm.sequence import SampleLogprobs
|
|
86
|
-
from vllm import SamplingParams
|
|
95
|
+
from vllm import SamplingParams, LLM
|
|
87
96
|
except ImportError:
|
|
88
97
|
raise ImportError(
|
|
89
98
|
"Please install vllm library. You can install it by running `pip install vllm`."
|
|
@@ -94,9 +103,21 @@ class Vllm(BaseGenerator):
|
|
|
94
103
|
|
|
95
104
|
sampling_params = pop_params(SamplingParams.from_optional, kwargs)
|
|
96
105
|
generate_params = SamplingParams(**sampling_params)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
if is_chat_prompt(prompts):
|
|
107
|
+
chat_template_kwargs = kwargs.pop("chat_template_kwargs", {})
|
|
108
|
+
chat_template_kwargs["enable_thinking"] = thinking
|
|
109
|
+
chat_kwargs = pop_params(LLM.chat, kwargs)
|
|
110
|
+
results: List[RequestOutput] = self.vllm_model.chat(
|
|
111
|
+
prompts,
|
|
112
|
+
generate_params,
|
|
113
|
+
chat_template_kwargs=chat_template_kwargs,
|
|
114
|
+
**chat_kwargs,
|
|
115
|
+
)
|
|
116
|
+
else:
|
|
117
|
+
generate_kwargs = pop_params(LLM.generate, kwargs)
|
|
118
|
+
results: List[RequestOutput] = self.vllm_model.generate(
|
|
119
|
+
prompts, generate_params, **generate_kwargs
|
|
120
|
+
)
|
|
100
121
|
generated_texts = list(map(lambda x: x.outputs[0].text, results))
|
|
101
122
|
generated_token_ids = list(map(lambda x: x.outputs[0].token_ids, results))
|
|
102
123
|
log_probs: List[SampleLogprobs] = list(
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import abc
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
|
|
5
|
+
from autorag.nodes.retrieval.base import BaseRetrieval
|
|
6
|
+
from autorag.utils import result_to_dataframe
|
|
7
|
+
from autorag.utils.util import pop_params, fetch_contents
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class HybridRetrieval(BaseRetrieval, metaclass=abc.ABCMeta):
|
|
11
|
+
def __init__(self, project_dir: str, *args, **kwargs):
|
|
12
|
+
super().__init__(project_dir)
|
|
13
|
+
|
|
14
|
+
@result_to_dataframe(["retrieved_contents", "retrieved_ids", "retrieve_scores"])
|
|
15
|
+
def pure(self, previous_result: pd.DataFrame, *args, **kwargs):
|
|
16
|
+
previous_info = self.cast_to_run(previous_result, *args, **kwargs)
|
|
17
|
+
_pure_params = pop_params(self._pure, kwargs)
|
|
18
|
+
ids, scores = self._pure(previous_info, **_pure_params)
|
|
19
|
+
contents = fetch_contents(self.corpus_df, ids)
|
|
20
|
+
return contents, ids, scores
|
|
21
|
+
|
|
22
|
+
def cast_to_run(self, previous_result: pd.DataFrame, *args, **kwargs):
|
|
23
|
+
return hybrid_cast(previous_result)
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def cast_to_run_class(cls, previous_result: pd.DataFrame):
|
|
27
|
+
return hybrid_cast(previous_result)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def hybrid_cast(
|
|
31
|
+
previous_result: pd.DataFrame,
|
|
32
|
+
):
|
|
33
|
+
assert "query" in previous_result.columns, "previous_result must have query column."
|
|
34
|
+
queries = previous_result["query"].tolist()
|
|
35
|
+
|
|
36
|
+
assert "retrieved_contents_semantic" in previous_result.columns
|
|
37
|
+
assert "retrieved_contents_lexical" in previous_result.columns
|
|
38
|
+
assert "retrieve_scores_semantic" in previous_result.columns
|
|
39
|
+
assert "retrieve_scores_lexical" in previous_result.columns
|
|
40
|
+
assert "retrieved_ids_semantic" in previous_result.columns
|
|
41
|
+
assert "retrieved_ids_lexical" in previous_result.columns
|
|
42
|
+
|
|
43
|
+
contents_semantic = previous_result["retrieved_contents_semantic"].tolist()
|
|
44
|
+
contents_lexical = previous_result["retrieved_contents_lexical"].tolist()
|
|
45
|
+
scores_semantic = previous_result["retrieve_scores_semantic"].tolist()
|
|
46
|
+
scores_lexical = previous_result["retrieve_scores_lexical"].tolist()
|
|
47
|
+
ids_semantic = previous_result["retrieved_ids_semantic"].tolist()
|
|
48
|
+
ids_lexical = previous_result["retrieved_ids_lexical"].tolist()
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
"queries": queries,
|
|
52
|
+
"retrieved_contents_semantic": contents_semantic,
|
|
53
|
+
"retrieved_contents_lexical": contents_lexical,
|
|
54
|
+
"retrieve_scores_semantic": scores_semantic,
|
|
55
|
+
"retrieve_scores_lexical": scores_lexical,
|
|
56
|
+
"retrieved_ids_semantic": ids_semantic,
|
|
57
|
+
"retrieved_ids_lexical": ids_lexical,
|
|
58
|
+
}
|