Skip to content

Commit

Permalink
Add Phi-2 dropout note (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca authored and rasbt committed Mar 18, 2024
1 parent bb83194 commit 15886ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tutorials/download_phi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ python scripts/download.py --repo_id microsoft/phi-2 --from_safetensors True
python scripts/convert_hf_checkpoint.py --checkpoint_dir checkpoints/microsoft/phi-2
```

> [!WARNING]
> Phi-2 used [dropout](https://huggingface.co/microsoft/phi-2/blob/cb2f453/config.json#L26) during training which we don't model, so training will not be equal.
Inference the model in instruct mode:

```bash
Expand All @@ -22,6 +25,7 @@ python chat/base.py --checkpoint_dir checkpoints/microsoft/phi-2
>> Prompt: Write a detailed analogy between mathematics and a lighthouse.
>> Reply: Mathematics is like a lighthouse. Mathematics provides a method to guide us through the sometimes chaotic and confusing waters of life. It provides a structured approach to problems which can help us find our way and provide direction. Just as a lighthouse keeps watch over the sea, mathematics can provide us with the tools to try and make sense of the world. Furthermore, just as a lighthouse keeps a watchful eye on the horizon, mathematics can help us reach our goals by showing us the way.
```

> [!NOTE]
> In order to obtain appropriate answers, you may need to tweak the [input prompt](https://github.com/Lightning-AI/lit-gpt/blob/74b8df0c3f07fc31d9d1a49e870a1f7955329ad8/chat/base.py#L359). E.g. we found out that if using `"Instruct:{prompt}\nOutput:\n"` instead of `"Instruct:{prompt}\nOutput:"` the model generates longer answers in some cases.
Expand Down

0 comments on commit 15886ac

Please sign in to comment.