lonePatient / albert_pytorch

A Lite Bert For Self-Supervised Learning Language Representations
Apache License 2.0
710 stars 152 forks source link

tf_path in the english model #20

Open Porcupine96 opened 4 years ago

Porcupine96 commented 4 years ago

Hello,

I wanted to ask for the purpose of adding tf_path = tf_path + "/variables/variables" in the english model. There's no analogous tf_path modification in the chinese version of the script. Removing this line seems to fix my issue with converting the model.

https://github.com/lonePatient/albert_pytorch/blob/3da2ebc5d71ce44be1123344d2f629fc21ffb01b/albert_english_pytorch/model/modeling_albert.py#L50

If it's indeed a bug, I've created a PR with a fix. If not, sorry for the trouble.

Thank you :)

lonePatient commented 4 years ago

@Porcupine96 Adding tf_path = tf_path + "/variables/variables" is for converting the weight of th_hub to the weight of pytorch.