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
9a86321b
"csrc/vscode:/vscode.git/clone" did not exist on "c6aa379de2251e64bab47a2704266abf150080a8"
Unverified
Commit
9a86321b
authored
Aug 19, 2020
by
Sam Shleifer
Committed by
GitHub
Aug 19, 2020
Browse files
tf generation utils: remove unused kwargs (#6591)
parent
2a7402cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
src/transformers/generation_tf_utils.py
src/transformers/generation_tf_utils.py
+2
-9
No files found.
src/transformers/generation_tf_utils.py
View file @
9a86321b
...
@@ -284,7 +284,7 @@ class TFGenerationMixin:
...
@@ -284,7 +284,7 @@ class TFGenerationMixin:
pad_token_id
=
eos_token_id
pad_token_id
=
eos_token_id
# current position and vocab size
# current position and vocab size
cur_len
=
shape_list
(
input_ids
)[
1
]
cur_len
=
shape_list
(
input_ids
)[
1
]
# unused
vocab_size
=
self
.
config
.
vocab_size
vocab_size
=
self
.
config
.
vocab_size
# set effective batch size and effective batch multiplier according to do_sample
# set effective batch size and effective batch multiplier according to do_sample
...
@@ -366,10 +366,8 @@ class TFGenerationMixin:
...
@@ -366,10 +366,8 @@ class TFGenerationMixin:
repetition_penalty
=
repetition_penalty
,
repetition_penalty
=
repetition_penalty
,
no_repeat_ngram_size
=
no_repeat_ngram_size
,
no_repeat_ngram_size
=
no_repeat_ngram_size
,
bad_words_ids
=
bad_words_ids
,
bad_words_ids
=
bad_words_ids
,
bos_token_id
=
bos_token_id
,
pad_token_id
=
pad_token_id
,
pad_token_id
=
pad_token_id
,
eos_token_id
=
eos_token_id
,
eos_token_id
=
eos_token_id
,
decoder_start_token_id
=
decoder_start_token_id
,
batch_size
=
effective_batch_size
,
batch_size
=
effective_batch_size
,
num_return_sequences
=
num_return_sequences
,
num_return_sequences
=
num_return_sequences
,
length_penalty
=
length_penalty
,
length_penalty
=
length_penalty
,
...
@@ -392,10 +390,8 @@ class TFGenerationMixin:
...
@@ -392,10 +390,8 @@ class TFGenerationMixin:
repetition_penalty
=
repetition_penalty
,
repetition_penalty
=
repetition_penalty
,
no_repeat_ngram_size
=
no_repeat_ngram_size
,
no_repeat_ngram_size
=
no_repeat_ngram_size
,
bad_words_ids
=
bad_words_ids
,
bad_words_ids
=
bad_words_ids
,
bos_token_id
=
bos_token_id
,
pad_token_id
=
pad_token_id
,
pad_token_id
=
pad_token_id
,
eos_token_id
=
eos_token_id
,
eos_token_id
=
eos_token_id
,
decoder_start_token_id
=
decoder_start_token_id
,
batch_size
=
effective_batch_size
,
batch_size
=
effective_batch_size
,
vocab_size
=
vocab_size
,
vocab_size
=
vocab_size
,
encoder_outputs
=
encoder_outputs
,
encoder_outputs
=
encoder_outputs
,
...
@@ -418,10 +414,8 @@ class TFGenerationMixin:
...
@@ -418,10 +414,8 @@ class TFGenerationMixin:
repetition_penalty
,
repetition_penalty
,
no_repeat_ngram_size
,
no_repeat_ngram_size
,
bad_words_ids
,
bad_words_ids
,
bos_token_id
,
pad_token_id
,
pad_token_id
,
eos_token_id
,
eos_token_id
,
decoder_start_token_id
,
batch_size
,
batch_size
,
vocab_size
,
vocab_size
,
encoder_outputs
,
encoder_outputs
,
...
@@ -582,9 +576,7 @@ class TFGenerationMixin:
...
@@ -582,9 +576,7 @@ class TFGenerationMixin:
repetition_penalty
,
repetition_penalty
,
no_repeat_ngram_size
,
no_repeat_ngram_size
,
bad_words_ids
,
bad_words_ids
,
bos_token_id
,
pad_token_id
,
pad_token_id
,
decoder_start_token_id
,
eos_token_id
,
eos_token_id
,
batch_size
,
batch_size
,
num_return_sequences
,
num_return_sequences
,
...
@@ -616,6 +608,7 @@ class TFGenerationMixin:
...
@@ -616,6 +608,7 @@ class TFGenerationMixin:
# cache compute states
# cache compute states
past
=
encoder_outputs
past
=
encoder_outputs
# to stay similar to torch : past = (encoder_outputs, None) if encoder_outputs is not None else None
# done sentences
# done sentences
done
=
[
False
for
_
in
range
(
batch_size
)]
done
=
[
False
for
_
in
range
(
batch_size
)]
...
...
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