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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Pre-Training Predictor: "model -> encoder -> encode_source extra fields not permitted (type=value_error.extra)" #104

Open
Qbop981001 opened this issue Jul 12, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Qbop981001
Copy link

When I use the predictor.yaml file in config/ to pretrain the predictor model, I got this error. The original message is:

Traceback (most recent call last):
File "/root/anaconda3/envs/kiwi37/bin/kiwi", line 5, in
main()
File "/root/qbp/qe/OpenKiwi-master/kiwi/main.py", line 21, in main
return kiwi.cli.cli()
File "/root/qbp/qe/OpenKiwi-master/kiwi/cli.py", line 84, in cli
train.train_from_configuration(config_dict)
File "/root/qbp/qe/OpenKiwi-master/kiwi/lib/train.py", line 249, in train_from_configuration
train_info = run(config)
File "/root/qbp/qe/OpenKiwi-master/kiwi/lib/train.py", line 341, in run
system = system_type.from_config(config.system, data_config=config.data)
File "/root/qbp/qe/OpenKiwi-master/kiwi/systems/qe_system.py", line 486, in from_config
config = system_cls.Config(**config.dict())
File "pydantic/main.py", line 362, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for Config
model -> encoder -> encode_source
extra fields not permitted (type=value_error.extra)

As the message shows, I assume it is the error of model -> encoder ->encode_source, but in fact I did not revise the original example predictor.yaml file in this project. In the original file, the value of encode_source is set to "false". I tried to override it to "true", and I get the same error.
How can I find the file demonstrating that how the values in .yaml file should be set ?

@Qbop981001 Qbop981001 added the bug Something isn't working label Jul 12, 2021
@Qbop981001 Qbop981001 changed the title Error Training Predictor: "model -> encoder -> encode_source extra fields not permitted (type=value_error.extra)" Error Pre-Training Predictor: "model -> encoder -> encode_source extra fields not permitted (type=value_error.extra)" Jul 12, 2021
@captainvera
Copy link
Contributor

hey @Qbop981001!

Sorry it took me a while to get a look at this. you are absolutely correct, it is indeed a bug in our example files.

The predictor encoder by default always encodes source, as such, that flag does not make sense and is probably a leftover from another config.

The correct way to fix this is to simply remove the flag from the yaml :)

Let me know if you have any other questions!

@captainvera captainvera self-assigned this Jul 20, 2021
zolastro added a commit to zolastro/OpenKiwi that referenced this issue Jun 23, 2022
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

2 participants