Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mi_counseling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shensq
mi_counseling
Commits
0a58afd0
Commit
0a58afd0
authored
5 years ago
by
shensq
Browse files
Options
Downloads
Patches
Plain Diff
Gptdataset_full now use x_y_with_comet
parent
2eaec2db
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
code/gpt_loader/load_data.py
+3
-1
3 additions, 1 deletion
code/gpt_loader/load_data.py
code/gpt_tuning.py
+1
-1
1 addition, 1 deletion
code/gpt_tuning.py
with
4 additions
and
2 deletions
code/gpt_loader/load_data.py
+
3
−
1
View file @
0a58afd0
...
...
@@ -354,6 +354,8 @@ class GptDataset_full(Dataset):
keyword_all
=
[]
for
x
,
y
,
meta
,
aug
,
keyword
in
x_y_meta
:
meta_all
.
append
(
meta
)
# update for the new data format
aug
=
''
.
join
([
a
[
1
]
for
a
in
aug
])
x_all
.
append
([
self
.
tokenizer
.
encode
(
text_standardize
(
x_i
))
for
x_i
in
x
])
y_all
.
append
(
self
.
tokenizer
.
encode
(
text_standardize
(
y
)))
aug_all
.
append
(
self
.
tokenizer
.
encode
(
text_standardize
(
aug
)))
...
...
@@ -531,7 +533,7 @@ def get_data(args, tokenizer, split_size):
gpt_data
=
GptDataset
(
x_y_meta
,
tokenizer
,
args
.
output_dir
,
num_turns
=
args
.
num_turns
)
elif
not
args
.
kbert
:
print
(
"
Using full data.
"
)
pickle_handler
=
open
(
'
../data_processed/x_y_
meta_all
'
,
'
rb
'
)
# TODO: change back to the old data.
pickle_handler
=
open
(
'
../data_processed/x_y_
with_comet
'
,
'
rb
'
)
# TODO: change back to the old data.
x_y_meta
=
pickle
.
load
(
pickle_handler
)
gpt_data
=
GptDataset_full
(
x_y_meta
,
tokenizer
,
args
=
args
)
else
:
...
...
This diff is collapsed.
Click to expand it.
code/gpt_tuning.py
+
1
−
1
View file @
0a58afd0
...
...
@@ -121,7 +121,7 @@ def main():
data_loader
,
test_loader
,
val_loader
=
get_data
(
args
,
split_size
=
split_size
,
tokenizer
=
tokenizer
)
# gpt_alex = prepare_mix_review(args, tokenizer)
# data_loader, val_loader = get_data(args, split_size=split_size, tokenizer=tokenizer) # TODO: this is for old get_data
import
pdb
;
pdb
.
set_trace
()
# ========== Prepare optimizer =============
# the gpt2 model from library has unnamed LM head. LM head's weights are tied to input embedding
num_train_optimization_steps
=
len
(
data_loader
)
*
args
.
num_train_epochs
//
args
.
train_batch_size
...
...
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