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
03e309d5
"vscode:/vscode.git/clone" did not exist on "5d3f03743301acf865be0dda93182c0abaadc49e"
Unverified
Commit
03e309d5
authored
Sep 12, 2023
by
Joao Gante
Committed by
GitHub
Sep 12, 2023
Browse files
Text2text pipeline: don't parameterize from the config (#26118)
parent
4fb64e28
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/transformers/pipelines/text2text_generation.py
src/transformers/pipelines/text2text_generation.py
+5
-3
No files found.
src/transformers/pipelines/text2text_generation.py
View file @
03e309d5
...
...
@@ -181,9 +181,11 @@ class Text2TextGenerationPipeline(Pipeline):
elif
self
.
framework
==
"tf"
:
in_b
,
input_length
=
tf
.
shape
(
model_inputs
[
"input_ids"
]).
numpy
()
generate_kwargs
[
"min_length"
]
=
generate_kwargs
.
get
(
"min_length"
,
self
.
model
.
config
.
min_length
)
generate_kwargs
[
"max_length"
]
=
generate_kwargs
.
get
(
"max_length"
,
self
.
model
.
config
.
max_length
)
self
.
check_inputs
(
input_length
,
generate_kwargs
[
"min_length"
],
generate_kwargs
[
"max_length"
])
self
.
check_inputs
(
input_length
,
generate_kwargs
.
get
(
"min_length"
,
self
.
model
.
config
.
min_length
),
generate_kwargs
.
get
(
"max_length"
,
self
.
model
.
config
.
max_length
),
)
output_ids
=
self
.
model
.
generate
(
**
model_inputs
,
**
generate_kwargs
)
out_b
=
output_ids
.
shape
[
0
]
if
self
.
framework
==
"pt"
:
...
...
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