Skip to content

RuntimeError when predicting with the french models #9

@maelchiotti

Description

@maelchiotti

I tried to use the french models (both fr.22000 and fr-txt.large.19000) on a very simple text:

j'aime les fleurs les olives et la raclette

When running python3 recasepunc.py predict fr.22000 < input.txt > output.txt (or with the other model), I get the following RuntimeError:

Traceback (most recent call last):
  File "/home/mael/charly/recasepunc/recasepunc.py", line 733, in <module>
    main(config, config.action, config.action_args)
  File "/home/mael/charly/recasepunc/recasepunc.py", line 707, in main
    generate_predictions(config, *args)
  File "/home/mael/charly/recasepunc/recasepunc.py", line 336, in generate_predictions
    model.load_state_dict(loaded['model_state_dict'])
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1497, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Model:
	Unexpected key(s) in state_dict: "bert.position_ids".

I tried the same with the english model, and it worked perfectly. Looks like something is broken with the french ones?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions