From 8caa9a28e6cd102c8e294a6a01a42a6ff8e41c76 Mon Sep 17 00:00:00 2001 From: Craig Macdonald Date: Thu, 3 Oct 2024 19:09:41 +0100 Subject: [PATCH] Bump pyterrier api (#14) * Update __init__.py * require pyterrier 0.9 (Nov' 22) --- pyterrier_t5/__init__.py | 5 ++--- requirements.txt | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyterrier_t5/__init__.py b/pyterrier_t5/__init__.py index 56bab82..3524e8b 100644 --- a/pyterrier_t5/__init__.py +++ b/pyterrier_t5/__init__.py @@ -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', @@ -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', diff --git a/requirements.txt b/requirements.txt index 90ca197..a0094b6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -python-terrier>=0.5.0 -pandas +python-terrier>=0.9.0 transformers>=4.0.0 torch sentencepiece>=0.1.95