Skip to content

Commit

Permalink
[skip ci] add docs on pretrained-models configuration parameter (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielBusta authored Jan 25, 2024
1 parent 96b695d commit 4218387
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docs/using-pretrained-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: default
title: Using pretrained models
nav_order: 9
---

# Using Pretrained Models

Pretrained models are machine learning models trained previously that can be used as the starting point for your training tasks.
Utilizing pretrained models can reduce training time and resource usage.

## Configuration Parameters

To download and use models from previous training runs or external sources, use the `pretrained-models` configuration parameter. The keys in this parameter correspond to the training task `kinds` capable of using pretrained models.

```yaml
"pretrained-models":
{
# Configuration for train-teacher kind
"train-teacher":
{
"urls": ["https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/task-id/artifacts/public/build"],
"mode": "continue",
"type": "default",
},
# Configuration for train-backwards kind
"train-backwards":
{
"urls": ["https://storage.googleapis.com/bucket-name/models/ru-en/backward"],
"mode": "use",
"type": "default",
},
}
```

### The URLs Key

The `urls` key is a list that specifies the locations from which the pretrained models are downloaded.

### The Mode Key

#### Use Mode

In `use` mode, the pipeline only downloads the model without further training. The tasks that depend on the training task will use the downloaded model artifacts as they are.

#### Continue Mode

In `continue` mode the pipeline uses the downloaded model artifacts from the previous training run as a "checkpoint" and continues training. This is useful to `continue` training a model on the same corpus.

#### Init Mode

In `init` mode, the pipeline initializes model weights with the downloaded model using the `--pretrained-model` flag in `marian`. This is useful for fine-tuning an existing model on a different corpus.

### The Type Key

`default` is the `npz` format that we are using for the model artifacts, this was added with `opusmt` in mind.

0 comments on commit 4218387

Please sign in to comment.