You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LM_scoring.py script returns an error when called:
Traceback (most recent call last):
File "/nas-labs/MT/pytorchwork/Recipes/toy-antoine/eole/eole/bin/main.py", line 38, in <module>
main()
File "/nas-labs/MT/pytorchwork/Recipes/toy-antoine/eole/eole/bin/main.py", line 34, in main
bin_cls.run(args)
File "/nas-labs/MT/pytorchwork/Recipes/toy-antoine/eole/eole/bin/tools/LM_scoring.py", line 68, in run
config = PredictConfig(**config)
File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 214, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 3 validation errors for PredictConfig
bin
Extra inputs are not permitted [type=extra_forbidden, input_value='tools', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
sub_bin
Extra inputs are not permitted [type=extra_forbidden, input_value='LM_scoring', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
config
Extra inputs are not permitted [type=extra_forbidden, input_value='inference.yaml', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
(config.update(stuff_to_update) adds {'bin': 'tools', 'sub_bin': 'LM_scoring', 'config': 'inference.yaml'} which are unnecessary args for scoring)
I did not call the script correctly, there is an error when called properly (modified initial comment accordingly).
While this script needed adaptation (pad_token retrieval, lambda opts are now elsewhere in the config, loss function now returns estims), I had to also modify loss computation mainly because one expected dimension is not there anymore, which made me realize I maybe overgeneralized loss/ppl computation to the specific case of wiki103 type of model.
Should loss computation use reduction="sum" to handle tensors of different dimensions ?
Moreover, I do not replicate the valid perplexity observed in my training and I don't know why yet:
tensorboard: 20.9643 (3.0428 loss)
lm_scoring: 22.34 (3.11 loss)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The LM_scoring.py script returns an error when called:
(
config.update(stuff_to_update)adds{'bin': 'tools', 'sub_bin': 'LM_scoring', 'config': 'inference.yaml'}which are unnecessary args for scoring)I adapted the loading of the model, the vocab new logic and the computation of the loss as well.
To test it, I'm using a LM built with the wiki-103 recipe, I only changed training data (https://github.com/eole-nlp/eole/blob/main/recipes/wiki_103/wiki_103.yaml)