Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Recipes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
mirrored_repos
MachineLearning
meta-llama
Llama Recipes
Commits
41a46d81
Commit
41a46d81
authored
10 months ago
by
Kai Wu
Committed by
Matthias Reso
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix alpaca dataset by using 5% of the data as eval and make sure len((eval_loader)>0
parent
d24ea27b
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
src/llama_recipes/datasets/alpaca_dataset.py
+4
-2
4 additions, 2 deletions
src/llama_recipes/datasets/alpaca_dataset.py
src/llama_recipes/finetuning.py
+4
-0
4 additions, 0 deletions
src/llama_recipes/finetuning.py
with
8 additions
and
2 deletions
src/llama_recipes/datasets/alpaca_dataset.py
+
4
−
2
View file @
41a46d81
...
...
@@ -26,10 +26,12 @@ PROMPT_DICT = {
class
InstructionDataset
(
Dataset
):
def
__init__
(
self
,
dataset_config
,
tokenizer
,
partition
=
"
train
"
):
self
.
ann
=
json
.
load
(
open
(
dataset_config
.
data_path
))
# Use 5% of the dataset for evaluation
eval_length
=
int
(
len
(
self
.
ann
)
/
20
)
if
partition
==
"
train
"
:
self
.
ann
=
self
.
ann
[
200
:]
self
.
ann
=
self
.
ann
[
eval_length
:]
else
:
self
.
ann
=
self
.
ann
[:
200
]
self
.
ann
=
self
.
ann
[:
eval_length
]
self
.
tokenizer
=
tokenizer
...
...
This diff is collapsed.
Click to expand it.
src/llama_recipes/finetuning.py
+
4
−
0
View file @
41a46d81
...
...
@@ -250,6 +250,10 @@ def main(**kwargs):
pin_memory
=
True
,
**
val_dl_kwargs
,
)
if
len
(
eval_dataloader
)
==
0
:
raise
ValueError
(
"
The eval set size is too small for dataloader to load even one batch. Please increase the size of eval set.
"
)
else
:
print
(
f
"
--> Num of Validation Set Batches loaded =
{
len
(
eval_dataloader
)
}
"
)
# Initialize the optimizer and learning rate scheduler
if
fsdp_config
.
pure_bf16
and
fsdp_config
.
optimizer
==
"
anyprecision
"
:
...
...
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