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
30bc536d
Commit
30bc536d
authored
2 months ago
by
Kai Wu
Browse files
Options
Downloads
Patches
Plain Diff
remove double BOS manually during fine-tuning
parent
ff3df5b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
recipes/quickstart/finetuning/datasets/ocrvqa_dataset.py
+2
-1
2 additions, 1 deletion
recipes/quickstart/finetuning/datasets/ocrvqa_dataset.py
with
2 additions
and
1 deletion
recipes/quickstart/finetuning/datasets/ocrvqa_dataset.py
+
2
−
1
View file @
30bc536d
...
@@ -26,11 +26,11 @@ def replace_target(target, seq):
...
@@ -26,11 +26,11 @@ def replace_target(target, seq):
def
tokenize_dialogs
(
dialogs
,
images
,
processor
):
def
tokenize_dialogs
(
dialogs
,
images
,
processor
):
text_prompt
=
processor
.
apply_chat_template
(
dialogs
)
text_prompt
=
processor
.
apply_chat_template
(
dialogs
)
text_prompt
=
[
prompt
.
replace
(
'
<|begin_of_text|>
'
,
''
)
for
prompt
in
text_prompt
]
batch
=
processor
(
batch
=
processor
(
images
=
images
,
images
=
images
,
text
=
text_prompt
,
text
=
text_prompt
,
padding
=
True
,
padding
=
True
,
text_kwargs
=
{
"
add_special_tokens
"
:
False
},
return_tensors
=
"
pt
"
,
return_tensors
=
"
pt
"
,
)
)
label_list
=
[]
label_list
=
[]
...
@@ -137,3 +137,4 @@ class OCRVQADataCollator:
...
@@ -137,3 +137,4 @@ class OCRVQADataCollator:
def
get_data_collator
(
processor
):
def
get_data_collator
(
processor
):
return
OCRVQADataCollator
(
processor
)
return
OCRVQADataCollator
(
processor
)
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