nikitakit/self-attentive-parser

error integrating with spacy

Closed this issue · 1 comments

hi,

i'm trying to integrate benepar with spacy to work with french. i use the following code:

import spacy, benepar
nlp = spacy.load("fr_core_news_lg")
mdl = "benepar_fr2"
if spacy.__version__.startswith('2'):
    nlp.add_pipe(benepar.BeneparComponent(mdl))
else:
    nlp.add_pipe("benepar", config={"model": mdl})

and get the following error:

RuntimeError: Error(s) in loading state_dict for ChartParser:
	Unexpected key(s) in state_dict: "pretrained_model.embeddings.position_ids".

i tried with all the available french language models and get the same error. when i try with 'en_core_web_lg' and 'benepar_en3' it works fine. i don't really understand the traceback (attached) nor have an idea how to make it work..

thanks for your help !
bissera

output.txt

Ah sorry, someone had the same error in German in August and downgrading trasnformers as they did to 4.30.2 fixed the issue.