Skip to content

Commit

Permalink
hot fix for CPJKU/wechsel#2; waiting for pypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
thesofakillers committed Jan 13, 2023
1 parent 15cacc4 commit 85b99a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions claficle/models/gewechselt.py
Expand Up @@ -10,6 +10,7 @@
import hydra
import datasets
import transformers
import numpy as np

from claficle.models.plain_gpt2 import PlainGPT2

Expand Down Expand Up @@ -53,6 +54,7 @@ def custom_init(
lm.get_input_embeddings().weight.detach().numpy(),
)
print("Replacing source embeddings with target embeddings...")
target_embeddings=np.float32(target_embeddings)
lm.get_input_embeddings().weight.data = torch.from_numpy(target_embeddings)
print("Done.")

Expand Down

0 comments on commit 85b99a4

Please sign in to comment.