text
stringlengths
7
324k
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
463
# accelerate-aws-sagemaker Examples showcasing AWS SageMaker integration of πŸ€— Accelerate. Just give the `accelerate config` and do `accelerate launch` πŸš€. It's as simple as that! 1. Set up the accelerate config by running `accelerate config --config_file accelerate_config.yaml` and answer the SageMaker questions. 2....
notebooks/sagemaker/22_accelerate_sagemaker_examples/README.md/0
{ "file_path": "notebooks/sagemaker/22_accelerate_sagemaker_examples/README.md", "repo_id": "notebooks", "token_count": 3628 }
163
<jupyter_start><jupyter_text>Stable Diffusion on Amazon SageMakerWelcome to this Amazon SageMaker guide on how to use the [Stable Diffusion](https://huggingface.co/blog/stable_diffusion) to generate image for a given input prompt. We will deploy [CompVis/stable-diffusion-v1-4](https://huggingface.co/CompVis/stable-diff...
notebooks/sagemaker/23_stable_diffusion_inference/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/23_stable_diffusion_inference/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 4469 }
164
import os import argparse from transformers import ( AutoModelForCausalLM, AutoTokenizer, set_seed, default_data_collator, BitsAndBytesConfig, Trainer, TrainingArguments, ) from datasets import load_from_disk import torch from peft import PeftConfig, PeftModel def parse_arge(): """Pars...
notebooks/sagemaker/28_train_llms_with_qlora/scripts/run_clm.py/0
{ "file_path": "notebooks/sagemaker/28_train_llms_with_qlora/scripts/run_clm.py", "repo_id": "notebooks", "token_count": 2378 }
165
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
peft/docs/source/conceptual_guides/adapter.md/0
{ "file_path": "peft/docs/source/conceptual_guides/adapter.md", "repo_id": "peft", "token_count": 2203 }
166
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer. --> # Configuration [`PeftConfigMixin`] is the base configuration class for storing the adapter configuration of a [`PeftModel`], and [`PromptLearningCo...
peft/docs/source/package_reference/config.md/0
{ "file_path": "peft/docs/source/package_reference/config.md", "repo_id": "peft", "token_count": 224 }
167
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
peft/docs/source/quicktour.md/0
{ "file_path": "peft/docs/source/quicktour.md", "repo_id": "peft", "token_count": 2384 }
168
<jupyter_start><jupyter_code>from transformers import AutoModelForSeq2SeqLM import peft from peft import get_peft_config, get_peft_model, get_peft_model_state_dict, IA3Config, TaskType import torch from datasets import load_dataset import os os.environ["TOKENIZERS_PARALLELISM"] = "false" from transformers import AutoT...
peft/examples/conditional_generation/peft_ia3_seq2seq.ipynb/0
{ "file_path": "peft/examples/conditional_generation/peft_ia3_seq2seq.ipynb", "repo_id": "peft", "token_count": 2685 }
169
<jupyter_start><jupyter_text>Fine-tune FLAN-T5 using `bitsandbytes`, `peft` & `transformers` πŸ€— In this notebook we will see how to properly use `peft` , `transformers` & `bitsandbytes` to fine-tune `flan-t5-large` in a google colab!We will finetune the model on [`financial_phrasebank`](https://huggingface.co/datasets...
peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb/0
{ "file_path": "peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb", "repo_id": "peft", "token_count": 4290 }
170
<jupyter_start><jupyter_code>!pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git@main !pip install huggingface_hub !pip install bitsandbytes !pip install SentencePiece import os ...
peft/examples/multi_adapter_examples/PEFT_Multi_LoRA_Inference.ipynb/0
{ "file_path": "peft/examples/multi_adapter_examples/PEFT_Multi_LoRA_Inference.ipynb", "repo_id": "peft", "token_count": 1344 }
171
# Supervised Fine-tuning (SFT) with PEFT In this example, we'll see how to use [PEFT](https://github.com/huggingface/peft) to perform SFT using PEFT on various distributed setups. ## Single GPU SFT with QLoRA QLoRA uses 4-bit quantization of the base model to drastically reduce the GPU memory consumed by the base mode...
peft/examples/sft/README.md/0
{ "file_path": "peft/examples/sft/README.md", "repo_id": "peft", "token_count": 807 }
172
import argparse import json import logging import os from collections import Counter from dataclasses import dataclass from operator import attrgetter from typing import Dict, List, Optional, Union import safetensors import torch import torch.nn as nn from diffusers import UNet2DConditionModel from transformers import...
peft/examples/stable_diffusion/convert_sd_adapter_to_peft.py/0
{ "file_path": "peft/examples/stable_diffusion/convert_sd_adapter_to_peft.py", "repo_id": "peft", "token_count": 10390 }
173
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/mixed_model.py/0
{ "file_path": "peft/src/peft/mixed_model.py", "repo_id": "peft", "token_count": 6797 }
174
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/ia3/bnb.py/0
{ "file_path": "peft/src/peft/tuners/ia3/bnb.py", "repo_id": "peft", "token_count": 2193 }
175
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/lora/config.py/0
{ "file_path": "peft/src/peft/tuners/lora/config.py", "repo_id": "peft", "token_count": 6552 }
176
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/p_tuning/config.py/0
{ "file_path": "peft/src/peft/tuners/p_tuning/config.py", "repo_id": "peft", "token_count": 732 }
177
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/utils/integrations.py/0
{ "file_path": "peft/src/peft/utils/integrations.py", "repo_id": "peft", "token_count": 890 }
178
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/tests/test_feature_extraction_models.py/0
{ "file_path": "peft/tests/test_feature_extraction_models.py", "repo_id": "peft", "token_count": 3356 }
179
# Archived Changes ### Nov 22, 2021 * A number of updated weights anew new model defs * `eca_halonext26ts` - 79.5 @ 256 * `resnet50_gn` (new) - 80.1 @ 224, 81.3 @ 288 * `resnet50` - 80.7 @ 224, 80.9 @ 288 (trained at 176, not replacing current a1 weights as default since these don't scale as well to higher res, ...
pytorch-image-models/docs/archived_changes.md/0
{ "file_path": "pytorch-image-models/docs/archived_changes.md", "repo_id": "pytorch-image-models", "token_count": 9335 }
180
# Deep Layer Aggregation Extending β€œshallow” skip connections, **Dense Layer Aggregation (DLA)** incorporates more depth and sharing. The authors introduce two structures for deep layer aggregation (DLA): iterative deep aggregation (IDA) and hierarchical deep aggregation (HDA). These structures are expressed through ...
pytorch-image-models/docs/models/.templates/models/dla.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/dla.md", "repo_id": "pytorch-image-models", "token_count": 5955 }
181
# Inception ResNet v2 **Inception-ResNet-v2** is a convolutional neural architecture that builds on the Inception family of architectures but incorporates [residual connections](https://paperswithcode.com/method/residual-connection) (replacing the filter concatenation stage of the Inception architecture). {% include ...
pytorch-image-models/docs/models/.templates/models/inception-resnet-v2.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/inception-resnet-v2.md", "repo_id": "pytorch-image-models", "token_count": 864 }
182
# Res2NeXt **Res2NeXt** is an image model that employs a variation on [ResNeXt](https://paperswithcode.com/method/resnext) bottleneck residual blocks. The motivation is to be able to represent features at multiple scales. This is achieved through a novel building block for CNNs that constructs hierarchical residual-li...
pytorch-image-models/docs/models/.templates/models/res2next.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/res2next.md", "repo_id": "pytorch-image-models", "token_count": 905 }
183
# (Tensorflow) EfficientNet CondConv **EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method unifo...
pytorch-image-models/docs/models/.templates/models/tf-efficientnet-condconv.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/tf-efficientnet-condconv.md", "repo_id": "pytorch-image-models", "token_count": 2457 }
184
# Feature Extraction All of the models in `timm` have consistent mechanisms for obtaining various types of features from the model for tasks besides classification. ## Penultimate Layer Features (Pre-Classifier Features) The features from the penultimate model layer can be obtained in several ways without requiring ...
pytorch-image-models/hfdocs/source/feature_extraction.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/feature_extraction.mdx", "repo_id": "pytorch-image-models", "token_count": 2004 }
185
# EfficientNet **EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method uniformly scales network wi...
pytorch-image-models/hfdocs/source/models/efficientnet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/efficientnet.mdx", "repo_id": "pytorch-image-models", "token_count": 4915 }
186
# (Legacy) SE-ResNeXt **SE ResNeXt** is a variant of a [ResNeXt](https://www.paperswithcode.com/method/resnext) that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration. ## How do I use this...
pytorch-image-models/hfdocs/source/models/legacy-se-resnext.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/legacy-se-resnext.mdx", "repo_id": "pytorch-image-models", "token_count": 2730 }
187
# ResNeXt A **ResNeXt** repeats a [building block](https://paperswithcode.com/method/resnext-block) that aggregates a set of transformations with the same topology. Compared to a [ResNet](https://paperswithcode.com/method/resnet), it exposes a new dimension, *cardinality* (the size of the set of transformations) \\( ...
pytorch-image-models/hfdocs/source/models/resnext.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/resnext.mdx", "repo_id": "pytorch-image-models", "token_count": 3056 }
188
""" ONNX-runtime validation script This script was created to verify accuracy and performance of exported ONNX models running with the onnxruntime. It utilizes the PyTorch dataloader/processing pipeline for a fair comparison against the originals. Copyright 2020 Ross Wightman """ import argparse import numpy as np im...
pytorch-image-models/onnx_validate.py/0
{ "file_path": "pytorch-image-models/onnx_validate.py", "repo_id": "pytorch-image-models", "token_count": 1960 }
189
from torch.nn.modules.batchnorm import BatchNorm2d from torchvision.ops.misc import FrozenBatchNorm2d import timm from timm.utils.model import freeze, unfreeze def test_freeze_unfreeze(): model = timm.create_model('resnet18') # Freeze all freeze(model) # Check top level module assert model.fc.we...
pytorch-image-models/tests/test_utils.py/0
{ "file_path": "pytorch-image-models/tests/test_utils.py", "repo_id": "pytorch-image-models", "token_count": 776 }
190
""" Random Erasing (Cutout) Originally inspired by impl at https://github.com/zhunzhong07/Random-Erasing, Apache 2.0 Copyright Zhun Zhong & Liang Zheng Hacked together by / Copyright 2019, Ross Wightman """ import random import math import torch def _get_pixels(per_pixel, rand_color, patch_size, dtype=torch.float3...
pytorch-image-models/timm/data/random_erasing.py/0
{ "file_path": "pytorch-image-models/timm/data/random_erasing.py", "repo_id": "pytorch-image-models", "token_count": 2258 }
191
import math import numbers import random import warnings from typing import List, Sequence, Tuple, Union import torch import torchvision.transforms.functional as F try: from torchvision.transforms.functional import InterpolationMode has_interpolation_mode = True except ImportError: has_interpolation_mode =...
pytorch-image-models/timm/data/transforms.py/0
{ "file_path": "pytorch-image-models/timm/data/transforms.py", "repo_id": "pytorch-image-models", "token_count": 8644 }
192
""" Conv2d + BN + Act Hacked together by / Copyright 2020 Ross Wightman """ import functools from torch import nn as nn from .create_conv2d import create_conv2d from .create_norm_act import get_norm_act_layer class ConvNormAct(nn.Module): def __init__( self, in_channels, out_...
pytorch-image-models/timm/layers/conv_bn_act.py/0
{ "file_path": "pytorch-image-models/timm/layers/conv_bn_act.py", "repo_id": "pytorch-image-models", "token_count": 1885 }
193
""" Halo Self Attention Paper: `Scaling Local Self-Attention for Parameter Efficient Visual Backbones` - https://arxiv.org/abs/2103.12731 @misc{2103.12731, Author = {Ashish Vaswani and Prajit Ramachandran and Aravind Srinivas and Niki Parmar and Blake Hechtman and Jonathon Shlens}, Title = {Scaling Local Self...
pytorch-image-models/timm/layers/halo_attn.py/0
{ "file_path": "pytorch-image-models/timm/layers/halo_attn.py", "repo_id": "pytorch-image-models", "token_count": 4601 }
194
""" AvgPool2d w/ Same Padding Hacked together by / Copyright 2020 Ross Wightman """ import torch import torch.nn as nn import torch.nn.functional as F from typing import List, Tuple, Optional from .helpers import to_2tuple from .padding import pad_same, get_padding_value def avg_pool2d_same(x, kernel_size: List[int...
pytorch-image-models/timm/layers/pool2d_same.py/0
{ "file_path": "pytorch-image-models/timm/layers/pool2d_same.py", "repo_id": "pytorch-image-models", "token_count": 1294 }
195
import torch import torch.nn as nn class AsymmetricLossMultiLabel(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disable_torch_grad_focal_loss=False): super(AsymmetricLossMultiLabel, self).__init__() self.gamma_neg = gamma_neg self.gamma_pos = gamma_pos ...
pytorch-image-models/timm/loss/asymmetric_loss.py/0
{ "file_path": "pytorch-image-models/timm/loss/asymmetric_loss.py", "repo_id": "pytorch-image-models", "token_count": 1620 }
196
""" DaViT: Dual Attention Vision Transformers As described in https://arxiv.org/abs/2204.03645 Input size invariant transformer architecture that combines channel and spacial attention in each block. The attention mechanisms used are linear in complexity. DaViT model defs and weights adapted from https://github.com/...
pytorch-image-models/timm/models/davit.py/0
{ "file_path": "pytorch-image-models/timm/models/davit.py", "repo_id": "pytorch-image-models", "token_count": 11881 }
197
""" MLP-Mixer, ResMLP, and gMLP in PyTorch This impl originally based on MLP-Mixer paper. Official JAX impl: https://github.com/google-research/vision_transformer/blob/linen/vit_jax/models_mixer.py Paper: 'MLP-Mixer: An all-MLP Architecture for Vision' - https://arxiv.org/abs/2105.01601 @article{tolstikhin2021, t...
pytorch-image-models/timm/models/mlp_mixer.py/0
{ "file_path": "pytorch-image-models/timm/models/mlp_mixer.py", "repo_id": "pytorch-image-models", "token_count": 11661 }
198
""" ResNeSt Models Paper: `ResNeSt: Split-Attention Networks` - https://arxiv.org/abs/2004.08955 Adapted from original PyTorch impl w/ weights at https://github.com/zhanghang1989/ResNeSt by Hang Zhang Modified for torchscript compat, and consistency with timm by Ross Wightman """ from torch import nn from timm.data...
pytorch-image-models/timm/models/resnest.py/0
{ "file_path": "pytorch-image-models/timm/models/resnest.py", "repo_id": "pytorch-image-models", "token_count": 4439 }
199
""" Visformer Paper: Visformer: The Vision-friendly Transformer - https://arxiv.org/abs/2104.12533 From original at https://github.com/danczs/Visformer Modifications and additions for timm hacked together by / Copyright 2021, Ross Wightman """ import torch import torch.nn as nn from timm.data import IMAGENET_DEFAU...
pytorch-image-models/timm/models/visformer.py/0
{ "file_path": "pytorch-image-models/timm/models/visformer.py", "repo_id": "pytorch-image-models", "token_count": 10132 }
200
""" Adan Optimizer Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models[J]. arXiv preprint arXiv:2208.06677, 2022. https://arxiv.org/abs/2208.06677 Implementation adapted from https://github.com/sail-sg/Adan """ import math import torch from torch.optim import Optimizer class Adan(Opt...
pytorch-image-models/timm/optim/adan.py/0
{ "file_path": "pytorch-image-models/timm/optim/adan.py", "repo_id": "pytorch-image-models", "token_count": 2501 }
201
""" MultiStep LR Scheduler Basic multi step LR schedule with warmup, noise. """ import torch import bisect from timm.scheduler.scheduler import Scheduler from typing import List class MultiStepLRScheduler(Scheduler): """ """ def __init__( self, optimizer: torch.optim.Optimizer, ...
pytorch-image-models/timm/scheduler/multistep_lr.py/0
{ "file_path": "pytorch-image-models/timm/scheduler/multistep_lr.py", "repo_id": "pytorch-image-models", "token_count": 1029 }
202
""" Eval metrics and related Hacked together by / Copyright 2020 Ross Wightman """ class AverageMeter: """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum = 0 self.count = 0 ...
pytorch-image-models/timm/utils/metrics.py/0
{ "file_path": "pytorch-image-models/timm/utils/metrics.py", "repo_id": "pytorch-image-models", "token_count": 374 }
203
import pytest from text_generation import Client, AsyncClient from text_generation.errors import NotFoundError, ValidationError from text_generation.types import FinishReason, InputToken def test_generate(flan_t5_xxl_url, hf_headers): client = Client(flan_t5_xxl_url, hf_headers) response = client.generate("t...
text-generation-inference/clients/python/tests/test_client.py/0
{ "file_path": "text-generation-inference/clients/python/tests/test_client.py", "repo_id": "text-generation-inference", "token_count": 2116 }
204
# Preparing the Model Text Generation Inference improves the model in several aspects. ## Quantization TGI supports [bits-and-bytes](https://github.com/TimDettmers/bitsandbytes#bitsandbytes), [GPT-Q](https://arxiv.org/abs/2210.17323) and [AWQ](https://arxiv.org/abs/2306.00978) quantization. To speed up inference wit...
text-generation-inference/docs/source/basic_tutorials/preparing_model.md/0
{ "file_path": "text-generation-inference/docs/source/basic_tutorials/preparing_model.md", "repo_id": "text-generation-inference", "token_count": 548 }
205
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 17934, "logprob": null, "text": "Pour" }, { "id": 49833, "logprob": -10.5625, "text": " dΓ©g" }, { "id"...
text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m.json", "repo_id": "text-generation-inference", "token_count": 1544 }
206
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 4321, "logprob": -13.90625, "text": "Test" }, { "id": 200...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_grammar_llama/test_flash_llama_grammar.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_grammar_llama/test_flash_llama_grammar.json", "repo_id": "text-generation-inference", "token_count": 1048 }
207
[ { "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 3735, "logprob": -12.9140625, "text": "Test" ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_load.json", "repo_id": "text-generation-inference", "token_count": 4897 }
208
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 610, "logprob": null, "text": "def" }, { "id": 1489, "logprob": -5.2617188, "text": " print" }, { "id"...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder2/test_flash_starcoder2.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder2/test_flash_starcoder2.json", "repo_id": "text-generation-inference", "token_count": 1124 }
209
[ { "details": { "best_of_sequences": null, "finish_reason": "eos_token", "generated_tokens": 6, "prefill": [ { "id": 0, "logprob": null, "text": "<pad>" } ], "seed": null, "tokens": [ { "id": 259, ...
text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json", "repo_id": "text-generation-inference", "token_count": 2874 }
210
import pytest @pytest.fixture(scope="module") def flash_falcon_handle(launcher): with launcher("tiiuae/falcon-7b", trust_remote_code=True) as handle: yield handle @pytest.fixture(scope="module") async def flash_falcon(flash_falcon_handle): await flash_falcon_handle.health(300) return flash_falco...
text-generation-inference/integration-tests/models/test_flash_falcon.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_falcon.py", "repo_id": "text-generation-inference", "token_count": 884 }
211
import pytest @pytest.fixture(scope="module") def idefics_handle(launcher): with launcher( "HuggingFaceM4/idefics-9b-instruct", num_shard=2, dtype="float16" ) as handle: yield handle @pytest.fixture(scope="module") async def idefics(idefics_handle): await idefics_handle.health(300) r...
text-generation-inference/integration-tests/models/test_idefics.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_idefics.py", "repo_id": "text-generation-inference", "token_count": 552 }
212
import { check, randomSeed } from 'k6'; import http from 'k6/http'; import { Trend, Counter } from 'k6/metrics'; import { randomItem } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; const seed = 0; const host = __ENV.HOST || '127.0.0.1:8000'; const timePerToken = new Trend('time_per_token', true); const tokens =...
text-generation-inference/load_tests/common.js/0
{ "file_path": "text-generation-inference/load_tests/common.js", "repo_id": "text-generation-inference", "token_count": 1025 }
213
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use text_generation_client::GrammarType as ProtoGrammarType; use text_generation_client::{ Batch, NextTokenChooserParameters, Request, ShardedClient, StoppingCriteriaParameters, }; // Note: Request ids and batch ids cannot collide. const LIVENESS_I...
text-generation-inference/router/src/health.rs/0
{ "file_path": "text-generation-inference/router/src/health.rs", "repo_id": "text-generation-inference", "token_count": 1307 }
214
vllm-cuda: # Clone vllm pip install -U ninja packaging --no-cache-dir git clone https://github.com/vllm-project/vllm.git vllm build-vllm-cuda: vllm-cuda cd vllm && git fetch && git checkout f8a1e39fae05ca610be8d5a78be9d40f5274e5fc cd vllm && python setup.py build install-vllm-cuda: build-vllm-cuda pip uninst...
text-generation-inference/server/Makefile-vllm/0
{ "file_path": "text-generation-inference/server/Makefile-vllm", "repo_id": "text-generation-inference", "token_count": 332 }
215
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _matrix_cuh #define _matrix_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> class MatrixView_half { public: const half* data; const int height; const int width; __device__ __forceinline__ MatrixView_half(const half*...
text-generation-inference/server/exllama_kernels/exllama_kernels/matrix.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/matrix.cuh", "repo_id": "text-generation-inference", "token_count": 5380 }
216
#ifndef _qdq_4_cuh #define _qdq_4_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_4BIT == 1 // Permutation: // // 77775555 33331111 66664444 22220000 __forceinline__ __device__ void shuffle_4bit_8 ( uint32_t* q, int stride ) { uint32_t qa = q[0]; uint32_t qb = 0; #pragma unroll...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh", "repo_id": "text-generation-inference", "token_count": 3279 }
217
import pytest import torch from transformers import AutoTokenizer from text_generation_server.models import Model def get_test_model(): class TestModel(Model): def batch_type(self): raise NotImplementedError def generate_token(self, batch): raise NotImplementedError ...
text-generation-inference/server/tests/models/test_model.py/0
{ "file_path": "text-generation-inference/server/tests/models/test_model.py", "repo_id": "text-generation-inference", "token_count": 829 }
218
import torch import torch.distributed from opentelemetry import trace from transformers import AutoTokenizer from typing import Optional from text_generation_server.models import FlashCausalLM from text_generation_server.models.custom_modeling.flash_rw_modeling import ( RWConfig, FlashRWForCausalLM, ) from te...
text-generation-inference/server/text_generation_server/models/flash_rw.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/flash_rw.py", "repo_id": "text-generation-inference", "token_count": 1197 }
219
import torch import torch.distributed from typing import List, Optional, Tuple from transformers import ( AutoTokenizer, AutoConfig, ) from text_generation_server.models import Seq2SeqLM from text_generation_server.models.custom_modeling.t5_modeling import ( T5ForConditionalGeneration, ) from text_genera...
text-generation-inference/server/text_generation_server/models/t5.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/t5.py", "repo_id": "text-generation-inference", "token_count": 1678 }
220
import time import os from datetime import timedelta from loguru import logger from pathlib import Path from typing import Optional, List from huggingface_hub import file_download, hf_api, HfApi, hf_hub_download from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE from huggingface_hub.utils import ( LocalE...
text-generation-inference/server/text_generation_server/utils/hub.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/hub.py", "repo_id": "text-generation-inference", "token_count": 3480 }
221
parser: '@typescript-eslint/parser' parserOptions: ecmaFeatures: jsx: true ecmaVersion: latest sourceType: module project: ./tsconfig.json env: browser: true es6: true node: true jest: true ignorePatterns: ['index.js', 'target/'] plugins: - import - '@typescript-eslint' extends: - eslint:...
tokenizers/bindings/node/.eslintrc.yml/0
{ "file_path": "tokenizers/bindings/node/.eslintrc.yml", "repo_id": "tokenizers", "token_count": 2733 }
222
/* eslint-disable prettier/prettier */ // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html module.exports = { // All imported modules in your tests should be mocked automatically // automock: false, // Stop running tests after `n` failures ...
tokenizers/bindings/node/jest.config.js/0
{ "file_path": "tokenizers/bindings/node/jest.config.js", "repo_id": "tokenizers", "token_count": 1715 }
223
# `tokenizers-darwin-arm64` This is the **aarch64-apple-darwin** binary for `tokenizers`
tokenizers/bindings/node/npm/darwin-arm64/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/darwin-arm64/README.md", "repo_id": "tokenizers", "token_count": 33 }
224
# `tokenizers-win32-arm64-msvc` This is the **aarch64-pc-windows-msvc** binary for `tokenizers`
tokenizers/bindings/node/npm/win32-arm64-msvc/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/win32-arm64-msvc/README.md", "repo_id": "tokenizers", "token_count": 38 }
225
pub mod models; pub mod tokenizer;
tokenizers/bindings/node/src/tasks/mod.rs/0
{ "file_path": "tokenizers/bindings/node/src/tasks/mod.rs", "repo_id": "tokenizers", "token_count": 11 }
226
import pytest def pytest_addoption(parser): parser.addoption("--runslow", action="store_true", default=False, help="run slow tests") def pytest_configure(config): config.addinivalue_line("markers", "slow: mark test as slow to run") def pytest_collection_modifyitems(config, items): if config.getoption(...
tokenizers/bindings/python/conftest.py/0
{ "file_path": "tokenizers/bindings/python/conftest.py", "repo_id": "tokenizers", "token_count": 217 }
227
from typing import Dict, Iterator, List, Optional, Tuple, Union from tokenizers import AddedToken, Tokenizer, decoders, pre_tokenizers, trainers from tokenizers.models import BPE from tokenizers.normalizers import NFKC from .base_tokenizer import BaseTokenizer class SentencePieceBPETokenizer(BaseTokenizer): """...
tokenizers/bindings/python/py_src/tokenizers/implementations/sentencepiece_bpe.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/sentencepiece_bpe.py", "repo_id": "tokenizers", "token_count": 1655 }
228
stable
tokenizers/bindings/python/rust-toolchain/0
{ "file_path": "tokenizers/bindings/python/rust-toolchain", "repo_id": "tokenizers", "token_count": 2 }
229
use pyo3::prelude::*; use std::collections::VecDeque; /// An simple iterator that can be instantiated with a specified length. /// We use this with iterators that don't have a size_hint but we might /// know its size. This is useful with progress bars for example. pub struct MaybeSizedIterator<I> { length: Option<...
tokenizers/bindings/python/src/utils/iterators.rs/0
{ "file_path": "tokenizers/bindings/python/src/utils/iterators.rs", "repo_id": "tokenizers", "token_count": 1797 }
230
import copy import os import pickle import pytest from tokenizers import ( AddedToken, SentencePieceUnigramTokenizer, Tokenizer, models, normalizers, pre_tokenizers, trainers, ) from ..utils import data_dir, train_files class TestBpeTrainer: def test_can_modify(self): traine...
tokenizers/bindings/python/tests/bindings/test_trainers.py/0
{ "file_path": "tokenizers/bindings/python/tests/bindings/test_trainers.py", "repo_id": "tokenizers", "token_count": 4957 }
231
# Added Tokens <tokenizerslangcontent> <python> ## AddedToken [[autodoc]] tokenizers.AddedToken - content - lstrip - normalized - rstrip - single_word </python> <rust> The Rust API Reference is available directly on the [Docs.rs](https://docs.rs/tokenizers/latest/tokenizers/) website. </rust> <nod...
tokenizers/docs/source-doc-builder/api/added-tokens.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/api/added-tokens.mdx", "repo_id": "tokenizers", "token_count": 134 }
232
# Quicktour Let's have a quick look at the πŸ€— Tokenizers library features. The library provides an implementation of today's most used tokenizers that is both easy to use and blazing fast. ## Build a tokenizer from scratch To illustrate how fast the πŸ€— Tokenizers library is, let's train a new tokenizer on [wikitext-...
tokenizers/docs/source-doc-builder/quicktour.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/quicktour.mdx", "repo_id": "tokenizers", "token_count": 7936 }
233
Components ==================================================================================================== When building a Tokenizer, you can attach various types of components to this Tokenizer in order to customize its behavior. This page lists most provided components. .. _normalizers: .. entities:: python ...
tokenizers/docs/source/components.rst/0
{ "file_path": "tokenizers/docs/source/components.rst", "repo_id": "tokenizers", "token_count": 4236 }
234
<p align="center"> <br> <img src="https://huggingface.co/landing/assets/tokenizers/tokenizers-logo.png" width="600"/> <br> <p> <p align="center"> <img alt="Build" src="https://github.com/huggingface/tokenizers/workflows/Rust/badge.svg"> <a href="https://github.com/huggingface/tokenizers/blob/master/...
tokenizers/tokenizers/README.tpl/0
{ "file_path": "tokenizers/tokenizers/README.tpl", "repo_id": "tokenizers", "token_count": 259 }
235
use crate::tokenizer::{Decoder, Result}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Clone, Debug, Serialize, Default)] /// Strip is a simple trick which converts tokens looking like `<0x61>` /// to pure bytes, and attempts to make them into a string. If the tokens /// cannot be decoded you will get οΏ½ ...
tokenizers/tokenizers/src/decoders/strip.rs/0
{ "file_path": "tokenizers/tokenizers/src/decoders/strip.rs", "repo_id": "tokenizers", "token_count": 1217 }
236
use super::{super::OrderedVocabIter, WordLevel, WordLevelBuilder}; use serde::{ de::{MapAccess, Visitor}, ser::SerializeStruct, Deserialize, Deserializer, Serialize, Serializer, }; use std::collections::HashSet; impl Serialize for WordLevel { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Er...
tokenizers/tokenizers/src/models/wordlevel/serialization.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/wordlevel/serialization.rs", "repo_id": "tokenizers", "token_count": 2084 }
237
use serde::{Deserialize, Serialize}; use crate::tokenizer::{PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior}; use crate::utils::macro_rules_attribute; #[derive(Clone, Debug, PartialEq, Eq)] /// Pre tokenizes the numbers into single tokens. If individual_digits is set /// to true, then all digits are ...
tokenizers/tokenizers/src/pre_tokenizers/digits.rs/0
{ "file_path": "tokenizers/tokenizers/src/pre_tokenizers/digits.rs", "repo_id": "tokenizers", "token_count": 1667 }
238
use crate::parallelism::*; use crate::tokenizer::{Offsets, Token}; use crate::utils::padding::PaddingDirection; use crate::utils::truncation::TruncationDirection; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::ops::Range; /// Represents the output of a `Tokenizer`. #[derive(Default, Parti...
tokenizers/tokenizers/src/tokenizer/encoding.rs/0
{ "file_path": "tokenizers/tokenizers/src/tokenizer/encoding.rs", "repo_id": "tokenizers", "token_count": 17197 }
239
mod common; use common::*; use tokenizers::tokenizer::AddedToken; #[test] fn add_tokens() { let mut tokenizer = get_empty(); assert_eq!( tokenizer.add_special_tokens(&[ AddedToken::from("<cls>", true), AddedToken::from("<sep>", true) ]), 2 ); assert_eq!...
tokenizers/tokenizers/tests/added_tokens.rs/0
{ "file_path": "tokenizers/tokenizers/tests/added_tokens.rs", "repo_id": "tokenizers", "token_count": 1770 }
240
cff-version: "1.2.0" date-released: 2020-10 message: "If you use this software, please cite it using these metadata." title: "Transformers: State-of-the-Art Natural Language Processing" url: "https://github.com/huggingface/transformers" authors: - family-names: Wolf given-names: Thomas - family-names: Debut ...
transformers/CITATION.cff/0
{ "file_path": "transformers/CITATION.cff", "repo_id": "transformers", "token_count": 824 }
241
local base = import 'templates/base.libsonnet'; local tpus = import 'templates/tpus.libsonnet'; local utils = import "templates/utils.libsonnet"; local volumes = import "templates/volumes.libsonnet"; local bertBaseCased = base.BaseTest { frameworkPrefix: "hf", modelName: "bert-base-cased", mode: "example", con...
transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet/0
{ "file_path": "transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet", "repo_id": "transformers", "token_count": 371 }
242
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/accelerate.md/0
{ "file_path": "transformers/docs/source/en/accelerate.md", "repo_id": "transformers", "token_count": 1516 }
243
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/deepspeed.md/0
{ "file_path": "transformers/docs/source/en/deepspeed.md", "repo_id": "transformers", "token_count": 18766 }
244
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/internal/tokenization_utils.md/0
{ "file_path": "transformers/docs/source/en/internal/tokenization_utils.md", "repo_id": "transformers", "token_count": 428 }
245
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/barthez.md/0
{ "file_path": "transformers/docs/source/en/model_doc/barthez.md", "repo_id": "transformers", "token_count": 818 }
246
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/bort.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bort.md", "repo_id": "transformers", "token_count": 867 }
247
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/dinat.md/0
{ "file_path": "transformers/docs/source/en/model_doc/dinat.md", "repo_id": "transformers", "token_count": 1371 }
248
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/gpt_neo.md/0
{ "file_path": "transformers/docs/source/en/model_doc/gpt_neo.md", "repo_id": "transformers", "token_count": 1582 }
249
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/layoutlm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/layoutlm.md", "repo_id": "transformers", "token_count": 2088 }
250
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/mobilebert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mobilebert.md", "repo_id": "transformers", "token_count": 1548 }
251
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/nystromformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/nystromformer.md", "repo_id": "transformers", "token_count": 907 }
252
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/plbart.md/0
{ "file_path": "transformers/docs/source/en/model_doc/plbart.md", "repo_id": "transformers", "token_count": 1586 }
253
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/roberta.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roberta.md", "repo_id": "transformers", "token_count": 3783 }
254
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/splinter.md/0
{ "file_path": "transformers/docs/source/en/model_doc/splinter.md", "repo_id": "transformers", "token_count": 1101 }
255
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/trajectory_transformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/trajectory_transformer.md", "repo_id": "transformers", "token_count": 776 }
256
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/vision-encoder-decoder.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vision-encoder-decoder.md", "repo_id": "transformers", "token_count": 2537 }
257
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/whisper.md/0
{ "file_path": "transformers/docs/source/en/model_doc/whisper.md", "repo_id": "transformers", "token_count": 1948 }
258
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/perplexity.md/0
{ "file_path": "transformers/docs/source/en/perplexity.md", "repo_id": "transformers", "token_count": 2263 }
259
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/image_captioning.md/0
{ "file_path": "transformers/docs/source/en/tasks/image_captioning.md", "repo_id": "transformers", "token_count": 2704 }
260
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/text-to-speech.md/0
{ "file_path": "transformers/docs/source/en/tasks/text-to-speech.md", "repo_id": "transformers", "token_count": 7353 }
261
<!--- Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/docs/source/en/troubleshooting.md/0
{ "file_path": "transformers/docs/source/en/troubleshooting.md", "repo_id": "transformers", "token_count": 2569 }
262