Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinjdobler authored Sep 12, 2024
1 parent 824412b commit 89ac5cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ target_embeddings = FOCUS(
source_model.resize_token_embeddings(len(target_tokenizer))
source_model.get_input_embeddings().weight.data = target_embeddings

# if the model has separate output embeddings, apply FOCUS separately
if not model.config.tie_word_embeddings:
target_output_embeddings = FOCUS(
source_embeddings=source_model.get_output_embeddings().weight,
source_tokenizer=source_tokenizer,
target_tokenizer=target_tokenizer,
target_training_data_path="/path/to/data.txt"
# same argument options as above, fasttext models are cached!
)
model.get_output_embeddings().weight.data = target_output_embeddings

# Continue training the model on the target language with `target_tokenizer`.
# ...
```
Expand Down

0 comments on commit 89ac5cc

Please sign in to comment.