Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ArchchanaKugathasan opened this issue Nov 21, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ArchchanaKugathasan
Copy link

馃悰 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 ArchchanaKugathasan added the bug Something isn't working label Nov 21, 2023
@ArchchanaKugathasan
Copy link
Author

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

@Evstrife
Copy link

Evstrife commented Dec 8, 2023

Is it corrected from huggingface?

@thekaranacharya
Copy link

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
Copy link

avidale commented Dec 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants