vector listlengths 1.02k 1.02k | text stringlengths 2 11.8k |
|---|---|
[
0.03440274,
-0.0065460363,
-0.014569977,
0.035786923,
-0.0018942413,
0.0030188907,
-0.01575951,
-0.0075769653,
-0.018441366,
0.033306926,
0.004520226,
0.029759955,
0.047119927,
-0.030336697,
-0.021599036,
-0.006203595,
0.00058485375,
-0.03944924,
-0.04737946,
-0.03356646,
-0.... |
Please note that since the gold labels are available on the test set, evaluation is performed on the test set.
An example using these processors is given in the run_xnli.py script.
SQuAD
The Stanford Question Answering Dataset (SQuAD) is a benchmark that
evaluates the performance of models on question answering. Two ... |
[
0.008498549,
-0.0037075083,
0.0041383104,
0.042714674,
-0.021970904,
-0.04386348,
-0.0035965443,
-0.015391381,
0.00605081,
0.050756313,
-0.036030713,
0.028694026,
0.050312456,
-0.0058908914,
-0.008707423,
0.024359897,
-0.007049488,
-0.07195699,
-0.05717918,
-0.0115468,
0.0169... | [~data.processors.utils.SquadV1Processor]
[~data.processors.utils.SquadV2Processor] |
[
0.03294001,
-0.010776216,
0.024822863,
0.009339878,
-0.022613112,
0.0016140386,
-0.027857587,
-0.018517708,
-0.015276741,
0.0720084,
-0.028697293,
0.043399498,
0.04843773,
-0.019033317,
0.0023036648,
0.041779015,
0.012323041,
-0.056864243,
-0.07742965,
-0.047170807,
0.0111592... |
They both inherit from the abstract class [~data.processors.utils.SquadProcessor]
[[autodoc]] data.processors.squad.SquadProcessor
- all
Additionally, the following method can be used to convert SQuAD examples into
[~data.processors.utils.SquadFeatures] that can be used as model inputs.
[[autodoc]] data.processor... |
[
0.032275215,
0.018963095,
0.0040554875,
0.023854982,
-0.036998417,
-0.04211522,
-0.028592242,
-0.018330522,
0.023854982,
0.050212137,
-0.019651895,
0.038825847,
0.056931455,
-0.009509661,
-0.04087819,
0.015280121,
-0.007387032,
-0.07697695,
-0.051196136,
-0.03525533,
-0.00740... | Another example using these processors is given in the run_squad.py script. |
[
0.05061699,
0.01375034,
-0.02453561,
0.013518474,
-0.012534802,
-0.0012164167,
-0.0060601267,
-0.0072510736,
0.0036466154,
0.056912497,
-0.007658595,
-0.0038222712,
0.03364161,
-0.0410051,
0.0055296463,
0.03968417,
-0.013420107,
-0.012541828,
-0.04673851,
-0.028863769,
-0.011... |
Trainer
The [Trainer] class provides an API for feature-complete training in PyTorch, and it supports distributed training on multiple GPUs/TPUs, mixed precision for NVIDIA GPUs, AMD GPUs, and torch.amp for PyTorch. [Trainer] goes hand-in-hand with the [TrainingArguments] class, which offers a wide range of options to... |
[
0.022746451,
-0.0027228717,
-0.0008168615,
0.029043965,
-0.018613271,
-0.016393084,
0.0047336076,
0.013949482,
0.002436621,
0.06808576,
-0.018375894,
0.02837372,
0.054736704,
-0.021559559,
-0.01333509,
0.033009585,
0.012064416,
-0.03644459,
-0.047531568,
-0.04937474,
-0.01704... | Using tensorflow_datasets is as easy as using a data file:
thon
tensorflow_datasets only handle Squad V1.
tfds_examples = tfds.load("squad")
examples = SquadV1Processor().get_examples_from_dataset(tfds_examples, evaluate=evaluate)
features = squad_convert_examples_to_features(
examples=examples,
tokenizer=token... |
[
0.007879123,
-0.0052069533,
-0.018341115,
-0.013230333,
-0.04687632,
-0.030857038,
0.035802957,
0.007308969,
-0.0007229972,
0.05498213,
0.038083576,
-0.012206802,
0.007164713,
-0.010977192,
-0.011842728,
0.03343991,
0.00842867,
-0.03517098,
-0.052481692,
-0.020388177,
0.03819... | your model always return tuples or subclasses of [~utils.ModelOutput]
your model can compute the loss if a labels argument is provided and that loss is returned as the first
element of the tuple (if your model returns tuples)
your model can accept multiple label arguments (use label_names in [TrainingArguments] to in... |
[
0.02951457,
0.017961642,
-0.011790021,
0.012170808,
-0.011998377,
-0.024370356,
0.0009825018,
-0.0006493133,
0.0022577783,
0.028796103,
0.03850976,
0.016452864,
0.032790773,
-0.038825884,
0.012156439,
0.012494118,
0.0035617936,
-0.012321686,
-0.08075554,
0.004016223,
0.001654... | The [Trainer] class is optimized for 🤗 Transformers models and can have surprising behaviors
when used with other models. When using it with your own model, make sure: |
[
0.01777731,
0.02215483,
0.017713685,
0.009028634,
-0.059860036,
-0.040390253,
0.0075779445,
0.018998945,
0.0028711567,
0.070040315,
0.00020758224,
0.0057295877,
0.011096504,
-0.031915173,
0.00723436,
0.019660663,
-0.011331922,
-0.016021213,
-0.044055153,
-0.008455994,
0.00013... | Trainer[[api-reference]]
[[autodoc]] Trainer
- all
Seq2SeqTrainer
[[autodoc]] Seq2SeqTrainer
- evaluate
- predict
TrainingArguments
[[autodoc]] TrainingArguments
- all
Seq2SeqTrainingArguments
[[autodoc]] Seq2SeqTrainingArguments
- all |
[
0.0072157993,
0.012000228,
-0.019421129,
-0.007596167,
-0.021479588,
-0.004195232,
-0.024179453,
-0.0074097123,
-0.043048676,
0.03845443,
-0.008524711,
0.010187888,
0.035799313,
-0.0642001,
0.03967757,
0.047583256,
0.00019764205,
-0.010366885,
-0.092541225,
0.013849859,
0.014... |
DeepSpeed
DeepSpeed, powered by Zero Redundancy Optimizer (ZeRO), is an optimization library for training and fitting very large models onto a GPU. It is available in several ZeRO stages, where each stage progressively saves more GPU memory by partitioning the optimizer state, gradients, parameters, and enabling offlo... |
[
0.00037785072,
-0.0010249339,
-0.01990998,
0.021686649,
-0.06824667,
0.0133884745,
0.00014849645,
0.011435548,
0.01686426,
0.076537795,
-0.013430776,
0.020318896,
0.03265688,
-0.058827505,
0.032572277,
0.051241405,
0.006288846,
-0.030823806,
-0.08375728,
0.010244051,
0.025014... | Learn more about using DeepSpeed with [Trainer] in the DeepSpeed guide.
HfDeepSpeedConfig
[[autodoc]] integrations.HfDeepSpeedConfig
- all |
[
0.012287332,
-0.00963539,
0.006478842,
-0.04714564,
-0.018887721,
0.023440221,
0.038895153,
-0.01604425,
-0.008530414,
0.023440221,
0.0427552,
-0.015720123,
0.0069392486,
-0.026858281,
-0.0010837972,
0.015410731,
-0.021539664,
0.021465998,
-0.08415496,
-0.0061915484,
0.003926... |
Configuration
The base class [PretrainedConfig] implements the common methods for loading/saving a configuration
either from a local file or directory, or from a pretrained model configuration provided by the library (downloaded
from HuggingFace's AWS S3 repository).
Each derived config class implements model specific... |
[
0.009106601,
0.0033454313,
-0.009992371,
-0.028930295,
-0.018593863,
0.0013872193,
0.023630312,
-0.029823385,
-0.011222202,
0.038329713,
0.008586851,
-0.022107664,
0.022444405,
-0.018432815,
-0.016017076,
0.021273136,
-0.03443525,
-0.030189406,
-0.03879822,
0.0293988,
-0.0195... | Logging
🤗 Transformers has a centralized logging system, so that you can setup the verbosity of the library easily.
Currently the default verbosity of the library is WARNING.
To change the level of verbosity, just use one of the direct setters. For instance, here is how to change the verbosity
to the INFO level.
thon
... |
[
0.028973203,
0.02179464,
-0.022657793,
-0.030757055,
-0.014357129,
-0.004966732,
0.01691782,
-0.016630102,
-0.011249774,
0.038065095,
0.016443085,
-0.021147273,
0.01726308,
-0.026024094,
-0.03228196,
0.018600969,
0.0048768204,
-0.054263618,
-0.05702571,
0.008746628,
-0.012105... | TRANSFORMERS_NO_ADVISORY_WARNINGS=1 ./myprogram.py
Here is an example of how to use the same logger as the library in your own module or script:
thon
from transformers.utils import logging
logging.set_verbosity_info()
logger = logging.get_logger("transformers")
logger.info("INFO")
logger.warning("WARN") |
[
-0.00894131,
-0.031371985,
0.00055929256,
0.00488713,
0.010054367,
-0.017086526,
0.030310525,
-0.0048429025,
-0.00061273406,
0.070292115,
0.004009953,
0.01984337,
0.007953565,
-0.022025255,
-0.04546579,
0.0051598656,
-0.063569546,
-0.08544738,
-0.0640413,
-0.009759517,
-0.009... |
Data Collator
Data collators are objects that will form a batch by using a list of dataset elements as input. These elements are of
the same type as the elements of train_dataset or eval_dataset.
To be able to build batches, data collators may apply some processing (like padding). Some of them (like
[DataCollatorForLa... |
[
0.030206883,
-0.005493151,
-0.00909111,
0.011501852,
-0.021391703,
-0.022669686,
0.02875463,
-0.0057364036,
-0.017615842,
0.054459527,
-0.0035144547,
0.039936986,
0.030264974,
-0.011530897,
-0.01822579,
0.008960407,
-0.032849986,
-0.05533088,
-0.034825053,
0.019576384,
-0.012... | All the methods of this logging module are documented below, the main ones are
[logging.get_verbosity] to get the current level of verbosity in the logger and
[logging.set_verbosity] to set the verbosity to the level of your choice. In order (from the least
verbose to the most verbose), those levels (with their corresp... |
[
0.009189308,
0.009900468,
0.0017639567,
-0.026145604,
-0.00041462568,
-0.033243265,
0.037984334,
-0.023091797,
-0.009426362,
0.05717172,
0.020818872,
0.011106652,
0.026968319,
-0.038988322,
-0.016119637,
-0.0006340309,
-0.026368713,
-0.031709388,
-0.049697563,
0.025057947,
0.... | transformers.logging.CRITICAL or transformers.logging.FATAL (int value, 50): only report the most
critical errors.
transformers.logging.ERROR (int value, 40): only report errors.
transformers.logging.WARNING or transformers.logging.WARN (int value, 30): only reports error and
warnings. This the default level used b... |
[
0.001515083,
-0.0029222164,
-0.026407897,
0.003291518,
-0.021271765,
-0.003920277,
-0.00061218825,
-0.0182719,
0.013143345,
0.0730876,
-0.015385668,
-0.0042422325,
0.028589617,
-0.004102087,
0.02152933,
0.024544345,
-0.013673624,
-0.03851341,
-0.059027635,
0.035119623,
0.0227... |
By default, tqdm progress bars will be displayed during model download. [logging.disable_progress_bar] and [logging.enable_progress_bar] can be used to suppress or unsuppress this behavior.
logging vs warnings
Python has two logging systems that are often used in conjunction: logging, which is explained above, and wa... |
[
-0.00037151284,
0.000013529775,
-0.0024399178,
-0.004579266,
-0.022362376,
-0.009802104,
0.04220704,
0.008224998,
-0.029279012,
0.04684642,
0.02253211,
-0.028996123,
0.03196646,
-0.008939293,
-0.04319715,
0.015360873,
-0.011930844,
-0.051287778,
-0.07026963,
0.02936388,
-0.00... | You can also use the environment variable TRANSFORMERS_VERBOSITY to override the default verbosity. You can set it
to one of the following: debug, info, warning, error, critical. For example:
TRANSFORMERS_VERBOSITY=error ./myprogram.py
Additionally, some warnings can be disabled by setting the environment variable
TRA... |
[
0.00685702,
0.018337876,
-0.045579854,
0.0035376637,
0.018481027,
-0.028530356,
-0.024851328,
-0.00321557,
0.005797689,
0.05353915,
0.0070681702,
0.058205932,
0.019855294,
-0.05766195,
-0.011394964,
0.004870774,
-0.012812177,
-0.036446705,
-0.047669888,
0.028587617,
-0.009727... |
Callbacks
Callbacks are objects that can customize the behavior of the training loop in the PyTorch
[Trainer] (this feature is not yet implemented in TensorFlow) that can inspect the training loop
state (for progress reporting, logging on TensorBoard or other ML platforms) and take decisions (like early
stopping).
Cal... |
[
0.028390376,
-0.016746398,
-0.008889255,
-0.03564424,
0.002892824,
-0.030905243,
-0.027300116,
-0.0048952685,
-0.01286507,
0.0469248,
0.0027837977,
0.020264303,
0.02282278,
-0.04241839,
-0.0115349535,
0.018578034,
-0.028608428,
-0.054164127,
-0.063380465,
-0.0038122765,
-0.00... |
Image Processor
An image processor is in charge of preparing input features for vision models and post processing their outputs. This includes transformations such as resizing, normalization, and conversion to PyTorch, TensorFlow, Flax and Numpy tensors. It may also include model specific post-processing such as conve... |
[
-0.013841965,
0.029880086,
-0.018605458,
0.02592082,
0.012016991,
-0.0021980887,
-0.027343681,
-0.008583565,
0.01824974,
0.071328655,
-0.024064913,
0.007423624,
0.035973642,
-0.038324457,
-0.04117018,
0.01874465,
-0.017476447,
-0.017723901,
-0.038077004,
0.028983064,
0.000367... |
[DefaultFlowCallback] which handles the default behavior for logging, saving and evaluation.
[PrinterCallback] or [ProgressCallback] to display progress and print the
logs (the first one is used if you deactivate tqdm through the [TrainingArguments], otherwise
it's the second one).
[~integrations.TensorBoardCallb... |
[
0.004994107,
0.027314138,
-0.035098247,
-0.027453637,
-0.01092984,
0.009869639,
0.020562328,
0.004359381,
-0.020729728,
0.048852965,
0.0038257926,
0.03562835,
0.015093921,
-0.02209683,
0.0010680483,
0.042463858,
0.0011500047,
-0.054711975,
-0.055493176,
0.018581426,
-0.028960... | trainer = Trainer(
model,
args,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
callbacks=[MyCallback], # We can either pass the callback class this way or an instance of it (MyCallback())
)
Another way to register a callback is to call trainer.add_callback() as follows:
thon
trainer = Tra... |
[
-0.004029504,
0.0073770355,
-0.029918792,
0.007157044,
-0.027689548,
0.00304871,
-0.016557997,
0.0025298977,
-0.011241546,
0.053736497,
0.0037306827,
0.021867117,
0.026941579,
-0.031620055,
-0.022351097,
0.028422851,
-0.004843471,
-0.02443368,
-0.067229286,
0.03848378,
-0.024... |
If a package is installed but you don't wish to use the accompanying integration, you can change TrainingArguments.report_to to a list of just those integrations you want to use (e.g. ["azure_ml", "wandb"]).
The main class that implements callbacks is [TrainerCallback]. It gets the
[TrainingArguments] used to instan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.