Closed qiuwenbogdut closed 11 months ago
Could you try to compare the difference of state dict between INSTRUCTOR and your re-trained model?
for example:
INSTRUCTOR :encoder.block.1.layer.0.layer_norm.weight
trained_by_myself: 0.auto_model.encoder.block.1.layer.0.layer_norm.weight
i try and solve the problem
import torch
self_weight= torch.load('pytorch_model.bin')
for key in list(self_weight.keys()):
if key.startswith('0.auto_model.'):
self_weight[key[len('0.auto_model.'):]] = self_weight[key]
del self_weight[key]
torch.save(self_weight,'pytorch_model.bin')
If you have removed the prefix 0.auto_model.
, why does the unused weight key still contain it?
If you have removed the prefix
0.auto_model.
, why does the unused weight key still contain it?
when remove the prefix 0.auto_model.
the weight is available for evaluating with retrained model
Feel free to re-open the issue if you have any further questions or comments!
Thanks for open sourcing this model! but now get an error: i cannot evaluate with retrained model.
train script:
evaluate script:
output
INFO:sentence_transformers.SentenceTransformer:Load pretrained SentenceTransformer: /container_data/qiuwenbo/instructor-embedding/download_weight/self-train-model/checkpoint-22000 WARNING:sentence_transformers.SentenceTransformer:No sentence-transformers model found with name /container_data/qiuwenbo/instructor-embedding/download_weight/self-train-model/checkpoint-22000. Creating a new one with MEAN pooling. Some weights of the model checkpoint at /container_data/qiuwenbo/instructor-embedding/download_weight/self-train-model/checkpoint-22000 were not used when initializing T5EncoderModel: ['0.auto_model.encoder.block.5.layer.1.DenseReluDense.wi.weight', '0.auto_model.encoder.block.1.layer.0.layer_norm.weight', '0.auto_model.encoder.block.23.layer.0.SelfAttention.v.weight', '0.auto_model.encoder.block.17.layer.0.SelfAttention.q.weight', '0.auto_model.encoder.block.12.layer.1.DenseReluDense.wo.weight',