Skip to content

Commit

Permalink
not quite fitting the paradigm yet but itll do
Browse files Browse the repository at this point in the history
  • Loading branch information
Parry-Parry committed Nov 13, 2024
1 parent eb60442 commit 003c811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rankers/modelling/pyterrier/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def __init__(self, model_name_or_path, device=None, batch_size=32, text_field='t
self.text_field = text_field
self.topk = topk

@classmethod
def from_pretrained(cls, model_name_or_path, device=None, batch_size=32, text_field='text', fp16=False, topk=None):
return cls(model_name_or_path, device, batch_size, text_field, fp16, topk)

def encode_queries(self, texts, out_fmt='dict', topk=None):
outputs = []
if out_fmt != 'dict':
Expand Down

0 comments on commit 003c811

Please sign in to comment.