Transformers documentation
일반 유틸리티 (General Utilities)
일반 유틸리티 (General Utilities)
이 페이지는 utils.py
파일에 있는 Transformers의 일반 유틸리티 함수들을 나열합니다.
이 함수들 대부분은 라이브러리의 일반적인 코드를 연구할 때만 유용합니다.
Enums 및 namedtuples
class transformers.utils.ExplicitEnum
< source >( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1 )
Enum with more explicit error message for missing values.
class transformers.utils.PaddingStrategy
< source >( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1 )
Possible values for the padding
argument in PreTrainedTokenizerBase.call(). Useful for tab-completion in an
IDE.
class transformers.TensorType
< source >( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1 )
Possible values for the return_tensors
argument in PreTrainedTokenizerBase.call(). Useful for
tab-completion in an IDE.
특수 데코레이터 (Special Decorators)
transformers.utils.add_code_sample_docstrings
< source >( *docstrprocessor_class = Nonecheckpoint = Noneoutput_type = Noneconfig_class = Nonemask = '[MASK]'qa_target_start_index = 14qa_target_end_index = 15model_cls = Nonemodality = Noneexpected_output = Noneexpected_loss = Nonereal_checkpoint = Nonerevision = None )
특수 속성 (Special Properties)
Descriptor that mimics @property but caches output in member variable.
From tensorflow_datasets
Built-in in functools from Python 3.8.
기타 유틸리티
class transformers.utils._LazyModule
< source >( name: strmodule_file: strimport_structure: typing.Dict[typing.FrozenSet[str], typing.Dict[str, typing.Set[str]]]module_spec: ModuleSpec = Noneextra_objects: typing.Dict[str, object] = None )
Module class that surfaces all objects but only performs associated imports when the objects are requested.