Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeBud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Atharva Jadhav
CodeBud
Commits
1d668cd3
Commit
1d668cd3
authored
1 month ago
by
Atharva Jadhav
Browse files
Options
Downloads
Patches
Plain Diff
Stabilize fine-tuning
parent
bf928bca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fine-tuning/main_fine_tuning.py
+8
-8
8 additions, 8 deletions
fine-tuning/main_fine_tuning.py
fine-tuning/slurm_finetune.sh
+1
-1
1 addition, 1 deletion
fine-tuning/slurm_finetune.sh
with
9 additions
and
9 deletions
fine-tuning/main_fine_tuning.py
+
8
−
8
View file @
1d668cd3
...
...
@@ -41,7 +41,7 @@ tokenizer = get_chat_template(
)
dataset
=
load_dataset
(
"
atharva2721/standardized-refined-train-aggregated
"
,
split
=
"
train
"
)
validation_dataset
=
load_dataset
(
"
atharva2721/standardized-refined-val-aggregated
"
,
split
=
"
train
"
)
validation_dataset
=
load_dataset
(
"
atharva2721/standardized-refined-val-
test-
aggregated
"
,
split
=
"
train
"
)
wandb
.
init
(
project
=
"
codebud
"
)
...
...
@@ -65,16 +65,16 @@ trainer = SFTTrainer(
fp16
=
not
is_bfloat16_supported
(),
bf16
=
is_bfloat16_supported
(),
eval_strategy
=
"
steps
"
,
eval_steps
=
656
,
eval_steps
=
410
,
per_device_eval_batch_size
=
1
,
fp16_full_eval
=
not
is_bfloat16_supported
(),
bf16_full_eval
=
is_bfloat16_supported
(),
logging_steps
=
10
,
save_steps
=
656
,
save_steps
=
410
,
optim
=
"
paged_adamw_8bit
"
,
# Save more memory
weight_decay
=
0.01
,
lr_scheduler_type
=
"
cosine
"
,
seed
=
3407
,
remove_unused_columns
=
False
,
output_dir
=
"
outputs
"
,
report_to
=
"
wandb
"
,
# Use this for WandB etc
run_name
=
"
run-name
"
...
...
@@ -117,10 +117,10 @@ print(f"Peak reserved memory % of max memory = {used_percentage} %.")
print
(
f
"
Peak reserved memory for training % of max memory =
{
lora_percentage
}
%.
"
)
print
(
f
'
Pushing model and tokenizer at
{
datetime
.
datetime
.
now
()
}
'
,
flush
=
True
)
model
.
save_pretrained
(
"
models/finetuned_model_with_eval
"
)
# Local saving
tokenizer
.
save_pretrained
(
"
models/finetuned_model_with_eval
"
)
model
.
push_to_hub
(
"
finetuned_model_with_eval
"
)
# Online saving
tokenizer
.
push_to_hub
(
"
finetuned_model_with_eval
"
)
# Online saving
model
.
save_pretrained
(
"
models/finetuned_model_with_
three_epochs_
eval
"
)
# Local saving
tokenizer
.
save_pretrained
(
"
models/finetuned_model_with_
three_epochs_
eval
"
)
model
.
push_to_hub
(
"
finetuned_model_with_
three_epochs_
eval
"
)
# Online saving
tokenizer
.
push_to_hub
(
"
finetuned_model_with_
three_epochs_
eval
"
)
# Online saving
wandb
.
finish
()
print
(
f
'
Run complete at
{
datetime
.
datetime
.
now
()
}
'
,
flush
=
True
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
fine-tuning/slurm_finetune.sh
+
1
−
1
View file @
1d668cd3
...
...
@@ -9,7 +9,7 @@
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --time=
1
2:00:00
#SBATCH --time=
2
2:00:00
###------------------------------------------------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment