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
a4851d94
Unverified
Commit
a4851d94
authored
Feb 19, 2024
by
Sadra Barikbin
Committed by
GitHub
Feb 19, 2024
Browse files
Fix two tiny typos in `pipelines/base.py::Pipeline::_sanitize_parameters()`'s docstring (#29102)
* Update base.py * Fix a typo
parent
5ce90f32
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/transformers/pipelines/base.py
src/transformers/pipelines/base.py
+3
-3
src/transformers/pipelines/conversational.py
src/transformers/pipelines/conversational.py
+1
-1
src/transformers/pipelines/text_generation.py
src/transformers/pipelines/text_generation.py
+1
-1
No files found.
src/transformers/pipelines/base.py
View file @
a4851d94
...
...
@@ -1048,9 +1048,9 @@ class Pipeline(_ScikitCompat):
def
_sanitize_parameters
(
self
,
**
pipeline_parameters
):
"""
_sanitize_parameters will be called with any excessive named arguments from either `__init__` or `__call__`
methods. It should return 3 diction
n
aries of the resolved parameters used by the various `preprocess`,
`forward` and `postprocess` methods. Do not fill diction
n
aries if the caller didn't specify a kwargs. This
let
'
s you keep defaults in function signatures, which is more "natural".
methods. It should return 3 dictionaries of the resolved parameters used by the various `preprocess`,
`forward` and `postprocess` methods. Do not fill dictionaries if the caller didn't specify a kwargs. This
lets you keep defaults in function signatures, which is more "natural".
It is not meant to be called directly, it will be automatically called and the final parameters resolved by
`__init__` and `__call__`
...
...
src/transformers/pipelines/conversational.py
View file @
a4851d94
...
...
@@ -272,7 +272,7 @@ class ConversationalPipeline(Pipeline):
Conversation to generate responses for. Inputs can also be passed as a list of dictionaries with `role`
and `content` keys - in this case, they will be converted to `Conversation` objects automatically.
Multiple conversations in either format may be passed as a list.
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `
Fals
e`):
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `
Tru
e`):
Whether or not to clean up the potential extra spaces in the text output.
generate_kwargs:
Additional keyword arguments to pass along to the generate method of the model (see the generate method
...
...
src/transformers/pipelines/text_generation.py
View file @
a4851d94
...
...
@@ -204,7 +204,7 @@ class TextGenerationPipeline(Pipeline):
return_full_text (`bool`, *optional*, defaults to `True`):
If set to `False` only added text is returned, otherwise the full text is returned. Only meaningful if
*return_text* is set to True.
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `
Fals
e`):
clean_up_tokenization_spaces (`bool`, *optional*, defaults to `
Tru
e`):
Whether or not to clean up the potential extra spaces in the text output.
prefix (`str`, *optional*):
Prefix added to prompt.
...
...
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