Skip to content

Commit

Permalink
Bump pyterrier api (#14)
Browse files Browse the repository at this point in the history
* Update __init__.py

* require pyterrier 0.9 (Nov' 22)
  • Loading branch information
cmacdonald authored Oct 3, 2024
1 parent bc506bf commit 8caa9a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pyterrier_t5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
import torch
from torch.nn import functional as F
from transformers import T5Config, T5Tokenizer, T5ForConditionalGeneration, MT5ForConditionalGeneration
from pyterrier.transformer import TransformerBase
from typing import List
import re


class MonoT5ReRanker(TransformerBase):
class MonoT5ReRanker(pt.Transformer):
def __init__(self,
tok_model='t5-base',
model='castorini/monot5-base-msmarco',
Expand Down Expand Up @@ -66,7 +65,7 @@ def transform(self, run):
return run


class DuoT5ReRanker(TransformerBase):
class DuoT5ReRanker(pt.Transformer):
def __init__(self,
tok_model='t5-base',
model='castorini/duot5-base-msmarco',
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
python-terrier>=0.5.0
pandas
python-terrier>=0.9.0
transformers>=4.0.0
torch
sentencepiece>=0.1.95

0 comments on commit 8caa9a2

Please sign in to comment.