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
ec00a2f7
Commit
ec00a2f7
authored
1 year ago
by
Matthias Reso
Browse files
Options
Downloads
Patches
Plain Diff
Fix batching error
parent
631046e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/custom_dataset.py
+1
-1
1 addition, 1 deletion
examples/custom_dataset.py
tests/datasets/test_custom_dataset.py
+4
-4
4 additions, 4 deletions
tests/datasets/test_custom_dataset.py
with
5 additions
and
5 deletions
examples/custom_dataset.py
+
1
−
1
View file @
ec00a2f7
...
...
@@ -27,7 +27,7 @@ def tokenize_dialog(dialog, tokenizer):
combined_tokens
=
{}
for
k
in
dialog_tokens
[
0
].
keys
():
combined_tokens
[
k
]
=
[
list
(
itertools
.
chain
(
*
(
t
[
k
]
for
t
in
dialog_tokens
)))
]
combined_tokens
[
k
]
=
list
(
itertools
.
chain
(
*
(
t
[
k
]
for
t
in
dialog_tokens
)))
return
combined_tokens
...
...
This diff is collapsed.
Click to expand it.
tests/datasets/test_custom_dataset.py
+
4
−
4
View file @
ec00a2f7
...
...
@@ -17,7 +17,7 @@ def test_custom_dataset(step_lr, optimizer, get_model, train, mocker):
"
model_name
"
:
"
decapoda-research/llama-7b-hf
"
,
# We use the tokenizer as a surrogate for llama2 tokenizer here
"
custom_dataset.file
"
:
"
examples/custom_dataset.py
"
,
"
custom_dataset.train_split
"
:
"
validation
"
,
"
batch_size_training
"
:
1
,
"
batch_size_training
"
:
2
,
"
use_peft
"
:
False
,
}
...
...
@@ -30,9 +30,9 @@ def test_custom_dataset(step_lr, optimizer, get_model, train, mocker):
eval_dataloader
=
args
[
2
]
tokenizer
=
args
[
3
]
assert
len
(
train_dataloader
)
==
22
41
assert
len
(
eval_dataloader
)
==
2
241
assert
len
(
train_dataloader
)
==
22
6
assert
len
(
eval_dataloader
)
==
2
*
226
STRING
=
tokenizer
.
decode
(
next
(
iter
(
train_dataloader
))[
"
input_ids
"
][
0
],
skip_special_tokens
=
True
)
EXPECTED_STRING
=
"
[INST] Напиши функцию на языке swift, которая сортирует массив целых чисел, а затем выводит его на экран [/INST] Вот функция,
"
...
...
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