Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
e4e0ee14
Commit
e4e0ee14
authored
Oct 16, 2019
by
Rémi Louf
Browse files
add separator between data import and train
parent
a424892f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
examples/run_seq2seq_finetuning.py
examples/run_seq2seq_finetuning.py
+9
-0
No files found.
examples/run_seq2seq_finetuning.py
View file @
e4e0ee14
...
@@ -52,6 +52,10 @@ def set_seed(args):
...
@@ -52,6 +52,10 @@ def set_seed(args):
torch
.
manual_seed
(
args
.
seed
)
torch
.
manual_seed
(
args
.
seed
)
# ------------
# Load dataset
# ------------
class
TextDataset
(
Dataset
):
class
TextDataset
(
Dataset
):
""" Abstracts the dataset used to train seq2seq models.
""" Abstracts the dataset used to train seq2seq models.
...
@@ -212,6 +216,11 @@ def load_and_cache_examples(args, tokenizer):
...
@@ -212,6 +216,11 @@ def load_and_cache_examples(args, tokenizer):
return
dataset
return
dataset
# ------------
# Train
# ------------
def
train
(
args
,
train_dataset
,
model
,
tokenizer
):
def
train
(
args
,
train_dataset
,
model
,
tokenizer
):
""" Fine-tune the pretrained model on the corpus. """
""" Fine-tune the pretrained model on the corpus. """
raise
NotImplementedError
raise
NotImplementedError
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment