Transformers documentation

أدوات عامة

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v5.22.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

أدوات عامة

تُدرج هذه الصفحة جميع دوال الأداة العامة في Transformers الموجودة في الملف utils.py.

معظمها لا يكون مفيدًا إلا إذا كنت تدرس الكود العام في المكتبة.

التعدادات و namedtuples

فئة transformers.utils.ExplicitEnum

< >

( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1boundary = None )

مع رسالة خطأ أكثر وضوحًا للقيم المفقودة.

فئة transformers.utils.PaddingStrategy

< >

( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1boundary = None )

القيم الممكنة لحجة padding في PreTrainedTokenizerBase.call(). مفيدة لإكمال الأوامر تلقائيًا في بيئة تطوير متكاملة.

فئة transformers.TensorType

< >

( valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1boundary = None )

القيم الممكنة لحجة return_tensors في PreTrainedTokenizerBase.call(). مفيدة لإكمال التبويب في بيئة تطوير متكاملة.

المُزيِّنات الخاصة

transformers.add_start_docstrings

< >

( *docstr )

transformers.utils.add_start_docstrings_to_model_forward

< >

( *docstr )

transformers.add_end_docstrings

< >

( *docstr )

transformers.utils.add_code_sample_docstrings

< >

( *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 )

transformers.utils.replace_return_docstrings

< >

( output_type = Noneconfig_class = None )

أدوات أخرى

فئة transformers.utils._LazyModule

< >

( name: strmodule_file: strimport_structure: dictmodule_spec: _frozen_importlib.ModuleSpec | None = Noneextra_objects: dict[str, object] | None = Noneexplicit_import_shortcut: dict[str, list[str]] | None = None )

فئة وحدة تعرض جميع الكائنات، لكنها لا تنفّذ الاستيرادات المرتبطة بها إلا عند طلب الكائنات.

Update on GitHub