Skip to content

Commit

Permalink
Tutorial convert_from_litgpt doc fix to remove output_dir command…
Browse files Browse the repository at this point in the history
… argument (Lightning-AI#1533)

Co-authored-by: Sebastian Raschka <[email protected]>
  • Loading branch information
jentfoo and rasbt authored Jun 27, 2024
1 parent c032d88 commit f88cfa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions tutorials/0_to_litgpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ Output: Example input.
Sometimes, it can be useful to convert LitGPT model weights for third-party and external tools. For example, we can convert a LitGPT model to the Hugging Face format and save it via `.safetensors` files, which we can do as follows:

```bash
litgpt convert_from_litgpt microsoft/phi-2 \
--output_dir out/converted_model/
litgpt convert_from_litgpt microsoft/phi-2 out/converted_model/
```

Certain tools like the `.from_pretrained` method in Hugging Face `transformers` also require the original `config.json` file that originally came with the downloaded model:
Expand Down
8 changes: 3 additions & 5 deletions tutorials/convert_lit_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ LitGPT weights need to be converted to a format that Hugging Face understands wi

We provide a helpful command to convert models LitGPT models back to their equivalent Hugging Face Transformers format:

```sh
litgpt convert_from_litgpt checkpoint_dir \
--output_dir converted_dir
```bash
litgpt convert_from_litgpt checkpoint_dir converted_dir
```

These paths are just placeholders, you will need to customize them based on which finetuning or pretraining command you ran and its configuration.
Expand Down Expand Up @@ -98,8 +97,7 @@ litgpt merge_lora $finetuned_dir/final
4. Convert the finetuning model back into a HF format:

```bash
litgpt convert from_litgpt $finetuned_dir/final/ \
--output_dir out/hf-tinyllama/converted \
litgpt convert_from_litgpt $finetuned_dir/final/ out/hf-tinyllama/converted
```


Expand Down

0 comments on commit f88cfa9

Please sign in to comment.