Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError #188

Open
fkurushin opened this issue Jun 14, 2024 · 0 comments
Open

RuntimeError #188

fkurushin opened this issue Jun 14, 2024 · 0 comments

Comments

@fkurushin
Copy link

fkurushin commented Jun 14, 2024

from bert_score import score

with open("/data/translator/parallel/kaggle/open_ru.txt", "r") as fo:
    txts = [t.strip() for t in fo.readlines()]

txts = list(set(txts))
size = 1_000_000
P, R, F1 = score(
    txts[0:size], txts[size:size*2], lang="ru", verbose=True, 
    model_type="DeepPavlov/rubert-base-cased",
    num_layers=12
    # rescale_with_baseline=True
)
Some weights of the model checkpoint at DeepPavlov/rubert-base-cased were not used when initializing BertModel: ['cls.predictions.bias', 'cls.predictions.decoder.bias', 'cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.seq_relationship.bias', 'cls.seq_relationship.weight']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
calculating scores...
computing bert embedding.
  2%|| 476/31250 [00:33<36:29, 14.06it/s] 
  ....
RuntimeError: The expanded size of the tensor (1174) must match the existing size (512) at non-singleton dimension 1.  Target sizes: [64, 1174].  Tensor sizes: [1, 512]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant