How to load model using transformers library

#2
by anushka1409 - opened

Hi, I'm trying to load this model using transformers library, but there is no model class for MT5ForRegression. Is there any alternate way to load it? I'm using python=3.9, transformers[torch]==4.30.2 ,sentencepiece==0.1.99
I'm using below code to load the model:

from transformers import AutoTokenizer, MT5ForRegression
tokenizer = AutoTokenizer.from_pretrained("google/metricx-23-xl-v2p0")
model = MT5ForRegression.from_pretrained("google/metricx-23-xl-v2p0")

hello did you solve?

The code to run it is here: https://github.com/google-research/metricx

basically not usable in huggingface, MT5ForRegression class would need to be integrated. It is already here:

https://github.com/google-research/metricx/blob/main/metricx23/models.py

Sign up or log in to comment