Comments (5)
Hi @dmar1n, I think you can try adding the @dataclass(init=False)
decorator to the classes of models.utils
inheriting from Transformers' ModelOutput
.
from comet.
Thanks a lot, @aRyBernAlTEglOTRO, for the hint! I have run a quick test, and I can confirm this is actually solving the issue I explained above.
When possible, I will propose a PR with this change; otherwise, the changes implemented in 2.1 won't work for training a UniTE model, and maybe other models.
from comet.
try this:
pip install unbabel-comet==2.0.1 --force-reinstall --no-cache-dir
from comet.
Hi @devrimcavusoglu, I encountered the same problem and tentatively applied the same solution as in your PR (i.e. adding the @dataclass
decorator to the classes of models.utils
inheriting from Transformers' ModelOutput
, as indicated in the Transformers doc). However, in my case, this produces another error later, when training a unified metric model, because the Target
class is passed in the scores, and as a dataclass, it does not accept any non-initialized argument (not declared in the Target class definition). I'm not sure if this is an issue with Transformers or COMET, but any hints would be appreciated.
Traceback
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/opt/mt/anaconda3/envs/comet/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/opt/mt/anaconda3/envs/comet/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
return self.collate_fn(data)
File "/opt/mt/anaconda3/envs/comet/lib/python3.10/site-packages/comet/models/base.py", line 511, in <lambda>
collate_fn=lambda s: self.prepare_sample(s, stage="validate"),
File "/opt/mt/anaconda3/envs/comet/lib/python3.10/site-packages/comet/models/multitask/unified_metric.py", line 362, in prepare_sample
targets = Target(score=torch.tensor(scores, dtype=torch.float))
TypeError: Target.__init__() got an unexpected keyword argument 'score'
from comet.
I'll try to bump the package version in the next few weeks.
from comet.
Related Issues (20)
- pretrained_model setting in hparams.yaml has no effect HOT 1
- [QUESTION] Why does training speed go down? HOT 5
- Multi-GPU training HOT 10
- Using comet-mbr for Multi-Model Translation Ranking: Questions About Input Format and GPU Disabling HOT 3
- 504 Server error when running comet-score using multiple machines HOT 7
- Is `wmt22-comet-da` the same as "COMET-22" & trained on MQM data? HOT 2
- Quantization HOT 2
- Not compatible with recent transformers? HOT 3
- Comet Evaluation Metric Error with Command line Utility HOT 1
- Running the code on Mac
- whar aspects of language gets considered while evaluating the tranlsation by COMET. as far as I am aware of MQM metric sare covered in it. Interested to know other terminolofy/features of language gets in COMET. HOT 1
- what aspects of language get considered while evaluating the translation by COMET. as far as I am aware of MQM metrics are covered in it. Interested in knowing other terminology/features of language gets in COMET. I am looking for metric along with COMET that can assess the translated content for cosmetic domain data. please suggest. HOT 1
- [QUESTION] Train Your Own Metric HOT 2
- Multi-gpu inference returns AttributeError HOT 7
- Mismatch between error span and offsets HOT 2
- [QUESTION] Reliability for en-th and th-en pair HOT 2
- AttributeError: 'dict' object has no attribute 'scores' HOT 2
- [QUESTION] AttributeError: An error occurred during model prediction: 'dict' object has no attribute 'scores' HOT 5
- AttributeError: 'dict' object has no attribute 'scores' when using the model 'Unbabel/wmt22-cometkiwi-da' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comet.