Unbabel / COMET

A Neural Framework for MT Evaluation
https://unbabel.github.io/COMET/html/index.html
Apache License 2.0
441 stars 72 forks source link

AttributeError: 'dict' object has no attribute 'scores' when using the model 'Unbabel/wmt22-cometkiwi-da' #186

Closed ArchchanaKugathasan closed 7 months ago

ArchchanaKugathasan commented 7 months ago

🐛 Bug

When I try to use the mode 'Unbabel/wmt22-cometkiwi-da' it pops the following error

Traceback (most recent call last): File "/COMETKIWI/main.py", line 19, in model_output = model.predict(data, batch_size=8, gpus=1) File "Anaconda3/envs/comet/lib/python3.9/site-packages/comet/models/base.py", line 652, in predict scores = torch.cat([pred.scores for pred in predictions], dim=0).tolist() File "Anaconda3/envs/comet/lib/python3.9/site-packages/comet/models/base.py", line 652, in scores = torch.cat([pred.scores for pred in predictions], dim=0).tolist()

AttributeError: 'dict' object has no attribute 'scores'

I can see the error is corrected in the repo, but when using the model directly(from huggingface) with the following command, it still shows the error. I think the model needs to be updated too.

comet-score -s src.txt -t hyp1.txt --model Unbabel/wmt22-cometkiwi-da

Environment

OS: [ Linux] Packaging [conda]

ArchchanaKugathasan commented 7 months ago

This issue was sorted when I modified the base.py inside the package installed in conda env

Evstrife commented 7 months ago

Is it corrected from huggingface?

thekaranacharya commented 7 months ago

The issue is within the COMET code, not on huggingface. The PR to fix this has been merged on main - but the package on PyPI has not been yet updated to include this fix. The only option rn is to download the repo and use the newest code.

Requesting here to please release a new package!

avidale commented 6 months ago

Can we please reopen this? Until the PyPI package is not updated, this issue is not really "solved".