Translation
Transformers
Inference Endpoints

TypeError: comet.models.utils.Prediction is not a dataclass

#2
by FrancescoBonzi - opened

Hi, I encountered an issue while running the model.predict with unbabel-comet==2.1.0 and unbabel-comet==2.0.2:

TypeError: comet.models.utils.Prediction is not a dataclasss. This is a subclass of ModelOutput and so must use the @dataclass decorator.

It works with unbabel-comet==2.0.1
Code:

from comet import download_model, load_from_checkpoint

model_path = download_model("Unbabel/wmt22-cometkiwi-da")
model = load_from_checkpoint(model_path)

data = [
    {
        "src": "10 到 15 εˆ†ι’Ÿε―δ»₯ι€εˆ°ε—",
        "mt": "Can I receive my food in 10 to 15 minutes?",
    },
    {
        "src": "Pode ser entregue dentro de 10 a 15 minutos?",
        "mt": "Can you send it for 10 to 15 minutes?",
    }
]
model_output = model.predict(data, batch_size=8, gpus=1)

May you fix it?
Thanks,
Francesco

Unbabel org

Working towards solving this. We already received a PR that seems to fix the issue.

Thanks πŸ™

Sign up or log in to comment