Repository navigation
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? |
Replies: 3 comments
|
By contextual embedding did you mean |
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? |
|
@KavyaGujjala I see that this question is being tracked in #645 (thanks for opening that). I will close this issue now. |
Hi @KavyaGujjala
By contextual embedding did you mean
BertEmbeddingin 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_parametersAPI to load the checkpoint file xx.params)