Skip to content

Commit f13c25d

Browse files
authored
Merge pull request #675 from hanhainebula/master
Fix bugs in step0-generate_embedding.py
2 parents 6507eef + 5304bcb commit f13c25d

2 files changed

Lines changed: 0 additions & 22 deletions

File tree

C_MTEB/MKQA/dense_retrieval/step0-generate_embedding.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
--max_passage_length 512 \
66
--batch_size 256 \
77
--fp16 \
8-
--add_instruction False \
98
--pooling_method cls \
109
--normalize_embeddings True
1110
"""
@@ -35,14 +34,6 @@ class ModelArgs:
3534
default=True,
3635
metadata={'help': 'Use fp16 in inference?'}
3736
)
38-
add_instruction: bool = field(
39-
default=False,
40-
metadata={'help': 'Add instruction?'}
41-
)
42-
passage_instruction_for_retrieval: str = field(
43-
default=None,
44-
metadata={'help': 'passage instruction for retrieval'}
45-
)
4637
pooling_method: str = field(
4738
default='cls',
4839
metadata={'help': "Pooling method. Avaliable methods: 'cls', 'mean'"}
@@ -78,8 +69,6 @@ def get_model(model_args: ModelArgs):
7869
model_args.encoder,
7970
pooling_method=model_args.pooling_method,
8071
normalize_embeddings=model_args.normalize_embeddings,
81-
# query_instruction_for_retrieval=model_args.query_instruction_for_retrieval if model_args.add_instruction else None,
82-
passage_instruction_for_retrieval=model_args.passage_instruction_for_retrieval if model_args.add_instruction else None,
8372
use_fp16=model_args.fp16
8473
)
8574
return model

C_MTEB/MLDR/dense_retrieval/step0-generate_embedding.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
--max_passage_length 8192 \
77
--batch_size 4 \
88
--fp16 \
9-
--add_instruction False \
109
--pooling_method cls \
1110
--normalize_embeddings True
1211
"""
@@ -30,14 +29,6 @@ class ModelArgs:
3029
default=True,
3130
metadata={'help': 'Use fp16 in inference?'}
3231
)
33-
add_instruction: bool = field(
34-
default=False,
35-
metadata={'help': 'Add instruction?'}
36-
)
37-
passage_instruction_for_retrieval: str = field(
38-
default=None,
39-
metadata={'help': 'passage instruction for retrieval'}
40-
)
4132
pooling_method: str = field(
4233
default='cls',
4334
metadata={'help': "Pooling method. Avaliable methods: 'cls', 'mean'"}
@@ -78,8 +69,6 @@ def get_model(model_args: ModelArgs):
7869
model_args.encoder,
7970
pooling_method=model_args.pooling_method,
8071
normalize_embeddings=model_args.normalize_embeddings,
81-
# query_instruction_for_retrieval=model_args.query_instruction_for_retrieval if model_args.add_instruction else None,
82-
passage_instruction_for_retrieval=model_args.passage_instruction_for_retrieval if model_args.add_instruction else None,
8372
use_fp16=model_args.fp16
8473
)
8574
return model

0 commit comments

Comments
 (0)