Big file_utils cleanup (#16396)

* Big file_utils cleanup

* This one still needs to be treated separately
This commit is contained in:
Sylvain Gugger
2022-03-25 07:25:20 -04:00
committed by GitHub
parent 2b23e0801a
commit 088c1880b7
222 changed files with 441 additions and 439 deletions

View File

@@ -12,35 +12,35 @@ specific language governing permissions and limitations under the License.
# General Utilities
This page lists all of Transformers general utility functions that are found in the file `file_utils.py`.
This page lists all of Transformers general utility functions that are found in the file `utils.py`.
Most of those are only useful if you are studying the general code in the library.
## Enums and namedtuples
[[autodoc]] file_utils.ExplicitEnum
[[autodoc]] utils.ExplicitEnum
[[autodoc]] file_utils.PaddingStrategy
[[autodoc]] utils.PaddingStrategy
[[autodoc]] file_utils.TensorType
[[autodoc]] utils.TensorType
## Special Decorators
[[autodoc]] file_utils.add_start_docstrings
[[autodoc]] utils.add_start_docstrings
[[autodoc]] file_utils.add_start_docstrings_to_model_forward
[[autodoc]] utils.add_start_docstrings_to_model_forward
[[autodoc]] file_utils.add_end_docstrings
[[autodoc]] utils.add_end_docstrings
[[autodoc]] file_utils.add_code_sample_docstrings
[[autodoc]] utils.add_code_sample_docstrings
[[autodoc]] file_utils.replace_return_docstrings
[[autodoc]] utils.replace_return_docstrings
## Special Properties
[[autodoc]] file_utils.cached_property
[[autodoc]] utils.cached_property
## Other Utilities
[[autodoc]] file_utils._LazyModule
[[autodoc]] utils._LazyModule

View File

@@ -25,7 +25,7 @@ Most of those are only useful if you are studying the code of the generate metho
## Generate Outputs
The output of [`~generation_utils.GenerationMixin.generate`] is an instance of a subclass of
[`~file_utils.ModelOutput`]. This output is a data structure containing all the information returned
[`~utils.ModelOutput`]. This output is a data structure containing all the information returned
by [`~generation_utils.GenerationMixin.generate`], but that can also be used as tuple or dictionary.
Here's an example: