Skip to content

Commit

Permalink
not lower() encoder name (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
crystina-z authored Nov 22, 2022
1 parent aa5feb7 commit a3b0631
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyserini/search/faiss/_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ def doc(self, docid: Union[str, int]) -> Optional[Document]:

@staticmethod
def _init_encoder_from_str(encoder):
encoder = encoder.lower()
if 'dpr' in encoder:
encoder_lower = encoder.lower()
if 'dpr' in encoder_lower:
return DprQueryEncoder(encoder_dir=encoder)
elif 'tct_colbert' in encoder:
elif 'tct_colbert' in encoder_lower:
return TctColBertQueryEncoder(encoder_dir=encoder)
elif 'ance' in encoder:
elif 'ance' in encoder_lower:
return AnceQueryEncoder(encoder_dir=encoder)
elif 'sentence' in encoder:
elif 'sentence' in encoder_lower:
return AutoQueryEncoder(encoder_dir=encoder, pooling='mean', l2_norm=True)
else:
return AutoQueryEncoder(encoder_dir=encoder)
Expand Down

0 comments on commit a3b0631

Please sign in to comment.