You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To streamline the experience for a general audience, without totally changing the experience, here are a few suggestions for changes (some of them are also discussed in separate issues/PRs). But this issue is to put it all in context.
So, below are
Improvement Suggestions: Things we would implement to streamline the experience to go from the "Current Experience" to the "Streamlined Experience"
"Current Experience": An example the 7 steps a user currently has to go through when finetuning with LoRA
"Streamlined Experience": the new 3-step experience after implementing all suggestions.
What do you think about this as a near-tearm improvement?
1) Improvement Suggestions
1. Convert downloaded HF checkpoint automatically upon download by default. Make it a flag to optionally disable though for debugging purposes, and keep the scripts/convert_hf_checkpoint.py for developers (but regular users don't have to worry about it.) (In progress via Automatically convert checkpoint files upon download #976)
3. LoRA merges weights by default via a (--merge_weights true). But this can be disabled if users or developers prefer it. Defaulting to true removes one extra step when evaluating or using the resulting model. But let's keep the scripts/merge_lora.py if developers and users set --merge_weights false and prefer doing it manually.
Instead of using TinyLlama, you can replace the repo_id target with any other model repository
specifier that is currently supported by Lit-GPT. You can get a list of supported repository specifier
by running scripts/download.py without any additional arguments.
Then, we download the model we specified via $repo_id above:
Experience Streamlining
To streamline the experience for a general audience, without totally changing the experience, here are a few suggestions for changes (some of them are also discussed in separate issues/PRs). But this issue is to put it all in context.
So, below are
What do you think about this as a near-tearm improvement?
1) Improvement Suggestions
1. Convert downloaded HF checkpoint automatically upon download by default. Make it a flag to optionally disable though for debugging purposes, and keep the
scripts/convert_hf_checkpoint.py
for developers (but regular users don't have to worry about it.) (In progress via Automatically convert checkpoint files upon download #976)2. Prepare the dataset automatically when running the finetuning script. (Addressed via Adrian's Dataset refactor in (4/n) Data Refactor - Finetuning Scripts #950 )
3. LoRA merges weights by default via a (
--merge_weights true
). But this can be disabled if users or developers prefer it. Defaulting to true removes one extra step when evaluating or using the resulting model. But let's keep thescripts/merge_lora.py
if developers and users set--merge_weights false
and prefer doing it manually.4. Finetuning and pretraining scripts also copies the tokenizer files from the original checkpoint directory (needed for inference and evaluation) and the HF
config.json
(needed for converting back to HF format). (See Standardize checkpoints in lit-gpt #923 and Download config.json for conversion script #965). In progress via Copy configs to new checkpoint dir #9842) Current Experience
git clone https://github.com/Lightning-AI/lit-gpt.git cd lit-gpt pip install -r requirements-all.txt
For convenience, we first specify an environment variable (optional) to avoid copy and pasting the whole path:
export repo_id=TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T
Instead of using TinyLlama, you can replace the
repo_id
target with any other model repositoryspecifier that is currently supported by Lit-GPT. You can get a list of supported repository specifier
by running
scripts/download.py
without any additional arguments.Then, we download the model we specified via
$repo_id
above:python scripts/download.py --repo_id $repo_id
python scripts/convert_hf_checkpoint.py --checkpoint_dir checkpoints/$repo_id
python scripts/prepare_alpaca.py \ --checkpoint_dir checkpoints/$repo_id \ --destination_path data/alpaca
Set
--train.epoch_size 100
for a quick dev run.Note that this step only applies if the model was finetuned with
lora.py
above and not whenfull.py
was used for finetuning.python chat/base.py --checkpoint_dir $finetuned_dir/merged/
3) Streamlined experience
git clone https://github.com/Lightning-AI/lit-gpt.git cd lit-gpt pip install -r requirements-all.txt
(By default,
--convert_hf_checkpoint true
.)By default, weights are merged after finetuning via
--merge_weights true
. This creates alit_model.pth
in the output directory.python chat/base.py --checkpoint_dir $finetuned_dir/
The text was updated successfully, but these errors were encountered: