Comments (7)
try this:
pip install unbabel-comet==2.0.1 --force-reinstall --no-cache-dir
from comet.
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.
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.
@ricardorei @devrimcavusoglu The change is overrided.
from comet.
I copied the old ModelOutput class from hugging face to utils. This error should not happen anymore
from comet.
Related Issues (20)
- [QUESTION] Train UnifiedMetric/XCOMET with word level predictions. HOT 1
- Sparsemax not actually used in COMET-KIWI, XCOMET-XL/XXL HOT 4
- Invalid link reference of reference-free model in readme
- Minimizing cpu RAM vs only use GPU RAM HOT 1
- what is the precision when load_from_checkpoint?
- Runtime error when loading wmt23-cometkiwi-da-xl HOT 1
- Different scores from different COMET package versions 1.1.2 and 2.2.1 HOT 2
- Different versions of COMET code give different scores with the same model and date.
- [QUESTION] large file scoring HOT 3
- [QUESTION] Splitting big models over multiple GPUs HOT 6
- [QUESTION] Memory footprint HOT 21
- [INPUT] Text Length of Input (source, reference, and hypothesis) HOT 2
- Change the global variable logger to comet_logger HOT 1
- Training script for XCOMET HOT 1
- Safetensors Support
- [QUESTION] OOM when load XCOMET-XXL in A100 with 40G memory for prediction HOT 4
- [QUESTION] why num_layers = num_hidden_layers + 1 HOT 1
- [QUESTION] Comet kiwi architecture HOT 11
- Training data and scripts used for wmt22-cometkiwi-da HOT 3
- Add missing library stubs or py.typed marker
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.