flashrag-dev 0.1.4.dev20250211__tar.gz → 0.1.4.dev20250214__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.
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/PKG-INFO +2 -2
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/README.md +1 -1
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/judger/judger.py +19 -3
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/utils.py +5 -1
- flashrag_dev-0.1.4.dev20250214/flashrag/version.py +1 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/PKG-INFO +2 -2
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/requires.txt +3 -3
- flashrag_dev-0.1.4.dev20250211/flashrag/version.py +0 -1
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/LICENSE +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/config/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/config/basic_config.yaml +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/config/config.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/dataset/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/dataset/dataset.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/dataset/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/_bleu.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/evaluator.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/metrics.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/fid.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/multimodal_generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/openai_generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/stop_word_criteria.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/judger/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/active_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/branching_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/mm_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/replug_utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/base_prompt.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/mm_prompt.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/selfask_examplars.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/trace_examplars.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/kg_refiner.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/llmlingua_compressor.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/refiner.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/selective_context_compressor.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/__main__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/encoder.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/index_builder.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/reranker.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/retriever.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/constants.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/pred_parse.py +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/SOURCES.txt +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/dependency_links.txt +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/top_level.txt +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/pyproject.toml +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/setup.cfg +0 -0
- {flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flashrag_dev
|
|
3
|
-
Version: 0.1.4.
|
|
3
|
+
Version: 0.1.4.dev20250214
|
|
4
4
|
Summary: A library for efficient Retrieval-Augmented Generation research
|
|
5
5
|
Home-page: https://github.com/RUC-NLPIR/FlashRAG
|
|
6
6
|
Author: Jiajie Jin, Yutao Zhu, Chenghao Zhang, Xinyu Yang, Zhicheng Dou
|
|
@@ -159,7 +159,7 @@ If you want to use vllm, sentence-transformers or pyserini, you can install the
|
|
|
159
159
|
|
|
160
160
|
```bash
|
|
161
161
|
# Install all extra dependencies
|
|
162
|
-
pip install flashrag[full]
|
|
162
|
+
pip install flashrag-dev[full]
|
|
163
163
|
|
|
164
164
|
# Install vllm for faster speed
|
|
165
165
|
pip install vllm>=0.4.1
|
|
@@ -142,7 +142,7 @@ If you want to use vllm, sentence-transformers or pyserini, you can install the
|
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
144
|
# Install all extra dependencies
|
|
145
|
-
pip install flashrag[full]
|
|
145
|
+
pip install flashrag-dev[full]
|
|
146
146
|
|
|
147
147
|
# Install vllm for faster speed
|
|
148
148
|
pip install vllm>=0.4.1
|
|
@@ -7,6 +7,7 @@ import torch
|
|
|
7
7
|
import faiss
|
|
8
8
|
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
|
9
9
|
from flashrag.retriever.utils import load_model, pooling
|
|
10
|
+
from flashrag.dataset import Dataset
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class BaseJudger:
|
|
@@ -84,8 +85,15 @@ class SKRJudger(BaseJudger):
|
|
|
84
85
|
return all_embeddings
|
|
85
86
|
|
|
86
87
|
def judge(self, dataset):
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
if isinstance(dataset, Dataset):
|
|
89
|
+
questions = dataset.question
|
|
90
|
+
elif isinstance(dataset, list):
|
|
91
|
+
questions = dataset
|
|
92
|
+
elif isinstance(dataset, str):
|
|
93
|
+
questions = [dataset]
|
|
94
|
+
else:
|
|
95
|
+
raise TypeError("dataset must be a Dataset or a list of str.")
|
|
96
|
+
|
|
89
97
|
all_judgements = []
|
|
90
98
|
for start_idx in range(0, len(questions), self.batch_size):
|
|
91
99
|
batch_question = questions[start_idx : start_idx + self.batch_size]
|
|
@@ -138,7 +146,15 @@ class AdaptiveJudger(BaseJudger):
|
|
|
138
146
|
|
|
139
147
|
@torch.inference_mode(mode=True)
|
|
140
148
|
def judge(self, dataset):
|
|
141
|
-
|
|
149
|
+
if isinstance(dataset, Dataset):
|
|
150
|
+
questions = dataset.question
|
|
151
|
+
elif isinstance(dataset, list):
|
|
152
|
+
questions = dataset
|
|
153
|
+
elif isinstance(dataset, str):
|
|
154
|
+
questions = [dataset]
|
|
155
|
+
else:
|
|
156
|
+
raise TypeError("dataset must be a Dataset or a list of str.")
|
|
157
|
+
|
|
142
158
|
questions = [q.strip() for q in questions]
|
|
143
159
|
|
|
144
160
|
all_preds = []
|
|
@@ -140,11 +140,15 @@ def get_refiner(config, retriever=None, generator=None):
|
|
|
140
140
|
print("Warning", e)
|
|
141
141
|
model_config, arch = "", ""
|
|
142
142
|
|
|
143
|
-
if "recomp" in refiner_name
|
|
143
|
+
if "recomp" in refiner_name:
|
|
144
144
|
if model_config.model_type == "t5":
|
|
145
145
|
refiner_class = "AbstractiveRecompRefiner"
|
|
146
146
|
else:
|
|
147
147
|
refiner_class = "ExtractiveRefiner"
|
|
148
|
+
elif 'bert' in arch:
|
|
149
|
+
refiner_class = "ExtractiveRefiner"
|
|
150
|
+
elif 'T5' in arch or 'Bart' in arch:
|
|
151
|
+
refiner_class = "AbstractiveRecompRefiner"
|
|
148
152
|
elif "lingua" in refiner_name:
|
|
149
153
|
refiner_class = "LLMLinguaRefiner"
|
|
150
154
|
elif "selective-context" in refiner_name or "sc" in refiner_name:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.4dev20250214"
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flashrag-dev
|
|
3
|
-
Version: 0.1.4.
|
|
3
|
+
Version: 0.1.4.dev20250214
|
|
4
4
|
Summary: A library for efficient Retrieval-Augmented Generation research
|
|
5
5
|
Home-page: https://github.com/RUC-NLPIR/FlashRAG
|
|
6
6
|
Author: Jiajie Jin, Yutao Zhu, Chenghao Zhang, Xinyu Yang, Zhicheng Dou
|
|
@@ -159,7 +159,7 @@ If you want to use vllm, sentence-transformers or pyserini, you can install the
|
|
|
159
159
|
|
|
160
160
|
```bash
|
|
161
161
|
# Install all extra dependencies
|
|
162
|
-
pip install flashrag[full]
|
|
162
|
+
pip install flashrag-dev[full]
|
|
163
163
|
|
|
164
164
|
# Install vllm for faster speed
|
|
165
165
|
pip install vllm>=0.4.1
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/requires.txt
RENAMED
|
@@ -17,7 +17,7 @@ bm25s[core]==0.2.0
|
|
|
17
17
|
fschat
|
|
18
18
|
streamlit
|
|
19
19
|
chonkie>=0.4.0
|
|
20
|
-
gradio
|
|
20
|
+
gradio>=5.0.0
|
|
21
21
|
rouge-chinese
|
|
22
22
|
jieba
|
|
23
23
|
|
|
@@ -41,7 +41,7 @@ bm25s[core]==0.2.0
|
|
|
41
41
|
fschat
|
|
42
42
|
streamlit
|
|
43
43
|
chonkie>=0.4.0
|
|
44
|
-
gradio
|
|
44
|
+
gradio>=5.0.0
|
|
45
45
|
rouge-chinese
|
|
46
46
|
jieba
|
|
47
47
|
|
|
@@ -65,7 +65,7 @@ bm25s[core]==0.2.0
|
|
|
65
65
|
fschat
|
|
66
66
|
streamlit
|
|
67
67
|
chonkie>=0.4.0
|
|
68
|
-
gradio
|
|
68
|
+
gradio>=5.0.0
|
|
69
69
|
rouge-chinese
|
|
70
70
|
jieba
|
|
71
71
|
pyserini
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.4dev20250211"
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/config/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/config/basic_config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/dataset/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/dataset/dataset.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/_bleu.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/evaluator.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/metrics.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/evaluator/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/generator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/generator/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/judger/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/mm_pipeline.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/pipeline.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/pipeline/replug_utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/base_prompt.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/mm_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/prompt/trace_examplars.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/kg_refiner.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/refiner/refiner.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/__main__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/encoder.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/reranker.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/retriever.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/retriever/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/constants.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag/utils/pred_parse.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250211 → flashrag_dev-0.1.4.dev20250214}/flashrag_dev.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|