model after running run_pretraining.py script #644
-
Hi, It seems like only checkpoints are saved. I have got two files 0000020.params and 0000020.states. How can I save the model or get a model from .params and .states files in checkpoint folder so that I can use that model to get contextual embeddings. Can someone please help me with this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
By contextual embedding did you mean
|
Beta Was this translation helpful? Give feedback.
-
Hey, Thanks a lot!!! This worked for me :) Also bert returns only word embeddings. Do you have any idea on how to get meaningful sentence representations? |
Beta Was this translation helpful? Give feedback.
-
@KavyaGujjala I see that this question is being tracked in #645 (thanks for opening that). I will close this issue now. |
Beta Was this translation helpful? Give feedback.
Hi @KavyaGujjala
By contextual embedding did you mean
BertEmbedding
in scripts/bert/embedding.py? You can modify this script with changes in https://github.com/dmlc/gluon-nlp/pull/640/files contributed by @Deseaus (which uses theload_parameters
API to load the checkpoint file xx.params)