Transformers documentation
一般的なユーティリティ
一般的なユーティリティ
このページには、ファイル utils.py
にある Transformers の一般的なユーティリティ関数がすべてリストされています。
これらのほとんどは、ライブラリで一般的なコードを学習する場合にのみ役に立ちます。
列挙型と名前付きタプル
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.
特別なデコレーター
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 )
特殊なプロパティ
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 >( namemodule_fileimport_structuremodule_spec = Noneextra_objects = None )
Module class that surfaces all objects but only performs associated imports when the objects are requested.