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.
Files changed (238) hide show
  1. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/PKG-INFO +6 -5
  2. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/SOURCES.txt +14 -5
  3. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/requires.txt +5 -4
  4. {autorag-0.3.16 → autorag-0.3.18}/PKG-INFO +6 -5
  5. autorag-0.3.18/autorag/VERSION +1 -0
  6. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/base.py +2 -2
  7. {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/api.py +12 -2
  8. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluator.py +65 -66
  9. {autorag-0.3.16 → autorag-0.3.18}/autorag/node_line.py +0 -8
  10. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/vllm.py +31 -10
  11. {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/__init__.py +0 -2
  12. autorag-0.3.18/autorag/nodes/hybridretrieval/base.py +58 -0
  13. {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/hybrid_cc.py +46 -33
  14. {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/hybridretrieval}/hybrid_rrf.py +53 -32
  15. autorag-0.3.18/autorag/nodes/hybridretrieval/run.py +137 -0
  16. autorag-0.3.18/autorag/nodes/lexicalretrieval/__init__.py +1 -0
  17. {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/lexicalretrieval}/bm25.py +7 -1
  18. autorag-0.3.18/autorag/nodes/lexicalretrieval/run.py +148 -0
  19. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/base.py +2 -6
  20. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/run.py +1 -1
  21. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/base.py +6 -11
  22. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/base.py +8 -18
  23. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/run.py +1 -1
  24. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/base.py +8 -19
  25. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/cohere.py +0 -1
  26. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/run.py +1 -1
  27. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/__init__.py +9 -0
  28. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/base.py +3 -5
  29. autorag-0.3.18/autorag/nodes/promptmaker/chat_fstring.py +73 -0
  30. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/run.py +1 -1
  31. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/run.py +35 -3
  32. autorag-0.3.18/autorag/nodes/retrieval/__init__.py +0 -0
  33. autorag-0.3.18/autorag/nodes/retrieval/run_util.py +152 -0
  34. autorag-0.3.18/autorag/nodes/semanticretrieval/__init__.py +1 -0
  35. autorag-0.3.18/autorag/nodes/semanticretrieval/run.py +148 -0
  36. {autorag-0.3.16/autorag/nodes/retrieval → autorag-0.3.18/autorag/nodes/semanticretrieval}/vectordb.py +38 -2
  37. {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/node.py +2 -1
  38. {autorag-0.3.16 → autorag-0.3.18}/autorag/support.py +30 -9
  39. autorag-0.3.18/autorag/utils/cast.py +45 -0
  40. {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/util.py +9 -1
  41. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/base.py +7 -0
  42. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/chroma.py +3 -0
  43. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/couchbase.py +21 -0
  44. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/milvus.py +3 -2
  45. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/pinecone.py +3 -1
  46. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/qdrant.py +3 -1
  47. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/weaviate.py +17 -0
  48. {autorag-0.3.16 → autorag-0.3.18}/pyproject.toml +8 -4
  49. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/compact_local.yaml +12 -2
  50. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/compact_openai.yaml +15 -1
  51. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/full.yaml +15 -1
  52. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu/half.yaml +15 -1
  53. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/compact.yaml +16 -2
  54. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/full.yaml +15 -1
  55. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/gpu_api/half.yaml +15 -1
  56. 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
  57. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/full.yaml +16 -3
  58. autorag-0.3.18/sample_config/rag/english/non_gpu/half.yaml +109 -0
  59. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_bedrock.yaml +1 -1
  60. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_local.yaml +1 -1
  61. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_ollama.yaml +1 -1
  62. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/english/non_gpu/simple_openai.yaml +1 -1
  63. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/extracted_sample.yaml +1 -1
  64. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/full.yaml +16 -2
  65. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/compact_korean.yaml +15 -1
  66. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/full_korean.yaml +15 -1
  67. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu/half_korean.yaml +15 -1
  68. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/compact_korean.yaml +15 -1
  69. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/full_korean.yaml +15 -1
  70. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/gpu_api/half_korean.yaml +15 -1
  71. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/compact_korean.yaml +15 -1
  72. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/full_korean.yaml +15 -1
  73. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/half_korean.yaml +15 -1
  74. {autorag-0.3.16 → autorag-0.3.18}/sample_config/rag/korean/non_gpu/simple_korean.yaml +1 -1
  75. {autorag-0.3.16 → autorag-0.3.18}/uv.lock +1523 -455
  76. autorag-0.3.16/autorag/VERSION +0 -1
  77. autorag-0.3.16/autorag/nodes/retrieval/run.py +0 -544
  78. autorag-0.3.16/sample_config/rag/english/non_gpu/compact.yaml +0 -83
  79. {autorag-0.3.16 → autorag-0.3.18}/.dockerignore +0 -0
  80. {autorag-0.3.16 → autorag-0.3.18}/.gitignore +0 -0
  81. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/dependency_links.txt +0 -0
  82. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/entry_points.txt +0 -0
  83. {autorag-0.3.16 → autorag-0.3.18}/AutoRAG.egg-info/top_level.txt +0 -0
  84. {autorag-0.3.16 → autorag-0.3.18}/Dockerfile.base +0 -0
  85. {autorag-0.3.16 → autorag-0.3.18}/Dockerfile.gpu +0 -0
  86. {autorag-0.3.16 → autorag-0.3.18}/autorag/__init__.py +0 -0
  87. {autorag-0.3.16 → autorag-0.3.18}/autorag/chunker.py +0 -0
  88. {autorag-0.3.16 → autorag-0.3.18}/autorag/cli.py +0 -0
  89. {autorag-0.3.16 → autorag-0.3.18}/autorag/dashboard.py +0 -0
  90. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/__init__.py +0 -0
  91. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/__init__.py +0 -0
  92. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/base.py +0 -0
  93. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/langchain_chunk.py +0 -0
  94. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/llama_index_chunk.py +0 -0
  95. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/chunk/run.py +0 -0
  96. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/__init__.py +0 -0
  97. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/__init__.py +0 -0
  98. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/langchain.py +0 -0
  99. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/corpus/llama_index.py +0 -0
  100. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/__init__.py +0 -0
  101. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/llama_index.py +0 -0
  102. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/llama_index_default_prompt.txt +0 -0
  103. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/ragas.py +0 -0
  104. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/legacy/qacreation/simple.py +0 -0
  105. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/__init__.py +0 -0
  106. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/base.py +0 -0
  107. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/clova.py +0 -0
  108. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/langchain_parse.py +0 -0
  109. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/llamaparse.py +0 -0
  110. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/run.py +0 -0
  111. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/parse/table_hybrid_parse.py +0 -0
  112. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/__init__.py +0 -0
  113. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/__init__.py +0 -0
  114. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/llama_index_query_evolve.py +0 -0
  115. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/openai_query_evolve.py +0 -0
  116. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/evolve/prompt.py +0 -0
  117. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/extract_evidence.py +0 -0
  118. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/__init__.py +0 -0
  119. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/dontknow.py +0 -0
  120. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/passage_dependency.py +0 -0
  121. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/filter/prompt.py +0 -0
  122. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/__init__.py +0 -0
  123. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/base.py +0 -0
  124. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/llama_index_gen_gt.py +0 -0
  125. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/openai_gen_gt.py +0 -0
  126. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/generation_gt/prompt.py +0 -0
  127. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/__init__.py +0 -0
  128. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/llama_gen_query.py +0 -0
  129. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/openai_gen_query.py +0 -0
  130. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/query/prompt.py +0 -0
  131. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/sample.py +0 -0
  132. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/qa/schema.py +0 -0
  133. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/utils/__init__.py +0 -0
  134. {autorag-0.3.16 → autorag-0.3.18}/autorag/data/utils/util.py +0 -0
  135. {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/__init__.py +0 -0
  136. {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/base.py +0 -0
  137. {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/gradio.py +0 -0
  138. {autorag-0.3.16 → autorag-0.3.18}/autorag/deploy/swagger.yml +0 -0
  139. {autorag-0.3.16 → autorag-0.3.18}/autorag/embedding/__init__.py +0 -0
  140. {autorag-0.3.16 → autorag-0.3.18}/autorag/embedding/base.py +0 -0
  141. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/__init__.py +0 -0
  142. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/generation.py +0 -0
  143. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/__init__.py +0 -0
  144. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/deepeval_prompt.py +0 -0
  145. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/coh_detailed.txt +0 -0
  146. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/con_detailed.txt +0 -0
  147. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/flu_detailed.txt +0 -0
  148. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/g_eval_prompts/rel_detailed.txt +0 -0
  149. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/generation.py +0 -0
  150. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/retrieval.py +0 -0
  151. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/retrieval_contents.py +0 -0
  152. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/metric/util.py +0 -0
  153. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/retrieval.py +0 -0
  154. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/retrieval_contents.py +0 -0
  155. {autorag-0.3.16 → autorag-0.3.18}/autorag/evaluation/util.py +0 -0
  156. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/__init__.py +0 -0
  157. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/__init__.py +0 -0
  158. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/base.py +0 -0
  159. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/llama_index_llm.py +0 -0
  160. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/openai_llm.py +0 -0
  161. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/run.py +0 -0
  162. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/generator/vllm_api.py +0 -0
  163. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/__init__.py +0 -0
  164. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/pass_passage_augmenter.py +0 -0
  165. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passageaugmenter/prev_next_augmenter.py +0 -0
  166. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/__init__.py +0 -0
  167. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/longllmlingua.py +0 -0
  168. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/pass_compressor.py +0 -0
  169. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/refine.py +0 -0
  170. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/run.py +0 -0
  171. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagecompressor/tree_summarize.py +0 -0
  172. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/__init__.py +0 -0
  173. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/pass_passage_filter.py +0 -0
  174. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/percentile_cutoff.py +0 -0
  175. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/recency.py +0 -0
  176. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/similarity_percentile_cutoff.py +0 -0
  177. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/similarity_threshold_cutoff.py +0 -0
  178. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagefilter/threshold_cutoff.py +0 -0
  179. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/__init__.py +0 -0
  180. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/colbert.py +0 -0
  181. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flag_embedding.py +0 -0
  182. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flag_embedding_llm.py +0 -0
  183. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/flashrank.py +0 -0
  184. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/jina.py +0 -0
  185. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/koreranker.py +0 -0
  186. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/mixedbreadai.py +0 -0
  187. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/monot5.py +0 -0
  188. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/openvino.py +0 -0
  189. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/pass_reranker.py +0 -0
  190. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/rankgpt.py +0 -0
  191. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/sentence_transformer.py +0 -0
  192. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/__init__.py +0 -0
  193. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/modeling_enc_t5.py +0 -0
  194. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/tart.py +0 -0
  195. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/tart/tokenization_enc_t5.py +0 -0
  196. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/time_reranker.py +0 -0
  197. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/upr.py +0 -0
  198. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/passagereranker/voyageai.py +0 -0
  199. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/fstring.py +0 -0
  200. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/long_context_reorder.py +0 -0
  201. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/promptmaker/window_replacement.py +0 -0
  202. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/__init__.py +0 -0
  203. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/base.py +0 -0
  204. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/hyde.py +0 -0
  205. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/multi_query_expansion.py +0 -0
  206. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/pass_query_expansion.py +0 -0
  207. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/queryexpansion/query_decompose.py +0 -0
  208. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/retrieval/base.py +0 -0
  209. {autorag-0.3.16 → autorag-0.3.18}/autorag/nodes/util.py +0 -0
  210. {autorag-0.3.16 → autorag-0.3.18}/autorag/parser.py +0 -0
  211. {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/__init__.py +0 -0
  212. {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/base.py +0 -0
  213. {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/metricinput.py +0 -0
  214. {autorag-0.3.16 → autorag-0.3.18}/autorag/schema/module.py +0 -0
  215. {autorag-0.3.16 → autorag-0.3.18}/autorag/strategy.py +0 -0
  216. {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/__init__.py +0 -0
  217. {autorag-0.3.16 → autorag-0.3.18}/autorag/utils/preprocess.py +0 -0
  218. {autorag-0.3.16 → autorag-0.3.18}/autorag/validator.py +0 -0
  219. {autorag-0.3.16 → autorag-0.3.18}/autorag/vectordb/__init__.py +0 -0
  220. {autorag-0.3.16 → autorag-0.3.18}/autorag/web.py +0 -0
  221. {autorag-0.3.16 → autorag-0.3.18}/build_and_push.sh +0 -0
  222. {autorag-0.3.16 → autorag-0.3.18}/docker-compose.yml +0 -0
  223. {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/chunk_full.yaml +0 -0
  224. {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/chunk_ko.yaml +0 -0
  225. {autorag-0.3.16 → autorag-0.3.18}/sample_config/chunk/simple_chunk.yaml +0 -0
  226. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/all_files_full.yaml +0 -0
  227. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/file_types_full.yaml +0 -0
  228. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_hybird.yaml +0 -0
  229. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_ko.yaml +0 -0
  230. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_multimodal.yaml +0 -0
  231. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/parse_ocr.yaml +0 -0
  232. {autorag-0.3.16 → autorag-0.3.18}/sample_config/parse/simple_parse.yaml +0 -0
  233. {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/README.md +0 -0
  234. {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/eli5/load_eli5_dataset.py +0 -0
  235. {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/hotpotqa/load_hotpotqa_dataset.py +0 -0
  236. {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/msmarco/load_msmarco_dataset.py +0 -0
  237. {autorag-0.3.16 → autorag-0.3.18}/sample_dataset/triviaqa/load_triviaqa_dataset.py +0 -0
  238. {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.16
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==2.9.2
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.8.0
35
- Requires-Dist: tokenlog>=0.0.2
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/bm25.py
164
- autorag/nodes/retrieval/hybrid_cc.py
165
- autorag/nodes/retrieval/hybrid_rrf.py
166
- autorag/nodes/retrieval/run.py
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==2.9.2
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.8.0
17
- tokenlog>=0.0.2
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.16
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==2.9.2
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.8.0
35
- Requires-Dist: tokenlog>=0.0.2
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.retrieval.vectordb import vectordb_ingest, vectordb_pure
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
- vectordb_ingest(collection, corpus_df, embeddings)
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: List[str] = df["retrieved_ids"].tolist()[0]
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.retrieval.bm25 import bm25_ingest
17
- from autorag.nodes.retrieval.vectordb import (
18
- vectordb_ingest,
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, yaml_path: str, skip_validation: bool = False, full_ingest: bool = True
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
- with Progress(
162
- "[progress.description]{task.description}",
163
- BarColumn(),
164
- "[progress.percentage]{task.percentage:>3.0f}%",
165
- "[progress.bar]{task.completed}/{task.total}",
166
- TimeElapsedColumn(),
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
- for i, (node_line_name, node_line) in enumerate(node_lines.items()):
199
- node_line_dir = os.path.join(
200
- self.project_dir, trial_name, node_line_name
201
- )
202
- os.makedirs(node_line_dir, exist_ok=False)
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
- trial_summary_df = self._append_node_line_summary(
211
- node_line_name, node_line_dir, trial_summary_df
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.to_csv(
215
- os.path.join(self.project_dir, trial_name, "summary.csv"), index=False
211
+ trial_summary_df = self._append_node_line_summary(
212
+ node_line_name, node_line_dir, trial_summary_df
216
213
  )
217
214
 
218
- logger.info("Evaluation complete.")
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 __ingest_vectordb(self, yaml_path, full_ingest: bool):
548
- vectordb_list = load_all_vectordb_from_yaml(yaml_path, self.project_dir)
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
- for vectordb in vectordb_list:
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
- for vectordb in vectordb_list:
557
- target_corpus = await filter_exist_ids_from_retrieval_gt(
558
- vectordb, self.qa_data, self.corpus_data
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
- del self.vllm_model.llm_engine.model_executor
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
- return self._pure(prompts, **kwargs)
66
+ thinking = kwargs.pop("thinking", False)
67
+ return self._pure(prompts, thinking=thinking, **kwargs)
66
68
 
67
69
  def _pure(
68
- self, prompts: List[str], **kwargs
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
- results: List[RequestOutput] = self.vllm_model.generate(
98
- prompts, generate_params
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(
@@ -1,4 +1,2 @@
1
- from .bm25 import BM25
2
1
  from .hybrid_cc import HybridCC
3
2
  from .hybrid_rrf import HybridRRF
4
- from .vectordb import VectorDB
@@ -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
+ }