text stringlengths 7 324k | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 463 |
|---|---|---|---|
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_img2img.py",
"repo_id": "diffusers",
"token_count": 4352
} | 139 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_depth.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_depth.py",
"repo_id": "diffusers",
"token_count": 11024
} | 140 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_k_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_k_diffusion.py",
"repo_id": "diffusers",
"token_count": 2096
} | 141 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video_zero_sdxl.py/0 | {
"file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video_zero_sdxl.py",
"repo_id": "diffusers",
"token_count": 7187
} | 142 |
import torch
from diffusers import DDPMScheduler
from .test_schedulers import SchedulerCommonTest
class DDPMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DDPMScheduler,)
def get_scheduler_config(self, **kwargs):
config = {
"num_train_timesteps": 1000,
"beta_start"... | diffusers/tests/schedulers/test_scheduler_ddpm.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_ddpm.py",
"repo_id": "diffusers",
"token_count": 3860
} | 143 |
import tempfile
from typing import Dict, List, Tuple
import torch
from diffusers import LCMScheduler
from diffusers.utils.testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class LCMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (LCMScheduler,)
forward_default_kwarg... | diffusers/tests/schedulers/test_scheduler_lcm.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_lcm.py",
"repo_id": "diffusers",
"token_count": 5668
} | 144 |
# coding=utf-8
# Copyright 2024 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... | diffusers/utils/check_table.py/0 | {
"file_path": "diffusers/utils/check_table.py",
"repo_id": "diffusers",
"token_count": 3010
} | 145 |
<jupyter_start><jupyter_text>Fine-Tuning and GuidanceIn this notebook, we're going to cover two main approaches for adapting existing diffusion models:* With **fine-tuning**, we'll re-train existing models on new data to change the type of output they produce* With **guidance**, we'll take an existing model and steer t... | diffusion-models-class/unit2/01_finetuning_and_guidance.ipynb/0 | {
"file_path": "diffusion-models-class/unit2/01_finetuning_and_guidance.ipynb",
"repo_id": "diffusion-models-class",
"token_count": 11877
} | 146 |
- title: Course introduction
sections:
- local: unit0/1
title: Introduction
- title: 1. Introduction to diffusion models
sections:
- local: unit1/1
title: Overview
- local: unit1/2
title: Implementation with 🤗 Diffusers
- local: unit1/3
title: Implementation from scratch
- title: 2. Fine-... | diffusion-models-class/units/en/_toctree.yml/0 | {
"file_path": "diffusion-models-class/units/en/_toctree.yml",
"repo_id": "diffusion-models-class",
"token_count": 424
} | 147 |
# Diffusion for Audio
<CourseFloatingBanner unit={4}
classNames="absolute z-10 right-0 top-0"
notebooks={[
{label: "Diffusion for Audio", value: "https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/units/en/unit4/diffusion_for_audio.ipynb"},
{label: "Diffusion for Audio", ... | diffusion-models-class/units/en/unit4/3.mdx/0 | {
"file_path": "diffusion-models-class/units/en/unit4/3.mdx",
"repo_id": "diffusion-models-class",
"token_count": 4647
} | 148 |
<jupyter_start><jupyter_text>Modèles (PyTorch) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece]
from transformers import CamembertConfig, CamembertModel
# Construire la configuration
config = CamembertConfig()
# Construire le modèle à parti... | notebooks/course/fr/chapter2/section3_pt.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter2/section3_pt.ipynb",
"repo_id": "notebooks",
"token_count": 341
} | 149 |
<jupyter_start><jupyter_text>Utilisation de modèles pré-entraînés (TensorFlow) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
from transformers import pipeline
camembert_fill_mask = pipeline("fill-mask", model="camembert-base")
re... | notebooks/course/fr/chapter4/section2_tf.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter4/section2_tf.ipynb",
"repo_id": "notebooks",
"token_count": 270
} | 150 |
<jupyter_start><jupyter_text>Tokenisation *Byte-Pair Encoding* Installez les bibliothèques 🤗 *Transformers* et 🤗 *Datasets* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
corpus = [
"C'est le cours d'Hugging Face.",
"Ce chapitre traite de la tokenisation.",
"Ce... | notebooks/course/fr/chapter6/section5.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter6/section5.ipynb",
"repo_id": "notebooks",
"token_count": 1572
} | 151 |
<jupyter_start><jupyter_text>Que faire quand vous obtenez une erreurCe chapitre portant sur le débogage, la langue nous importe peu ici. Nous nous intéressons surtout à la logique du code pour comprendre d'où provient l'erreur. Installez les bibliothèques 🤗 Transformers et 🤗 Datasets pour exécuter ce *notebook*.<jupy... | notebooks/course/fr/chapter8/section2.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter8/section2.ipynb",
"repo_id": "notebooks",
"token_count": 1365
} | 152 |
<jupyter_start><jupyter_text>Running IF with 🧨 diffusers on a Free Tier Google Colab_**TL;DR**: We show how to run one of the most powerful open-source text to image models **IF** on a free-tier Google Colab with 🧨 diffusers._*by DeepFloyd &* 🤗 *HuggingFace* *Image taken from official IF GitHub repo [here](https://... | notebooks/diffusers/deepfloyd_if_free_tier_google_colab.ipynb/0 | {
"file_path": "notebooks/diffusers/deepfloyd_if_free_tier_google_colab.ipynb",
"repo_id": "notebooks",
"token_count": 9958
} | 153 |
<jupyter_start><jupyter_text>🧨 Stable Diffusion in JAX / Flax ! 🤗 Hugging Face [Diffusers](https://github.com/huggingface/diffusers) supports Flax since version `0.5.1`! This allows for super fast inference on Google TPUs, such as those available in Colab, Kaggle or Google Cloud Platform.This notebook shows how to ru... | notebooks/diffusers/stable_diffusion_jax_how_to.ipynb/0 | {
"file_path": "notebooks/diffusers/stable_diffusion_jax_how_to.ipynb",
"repo_id": "notebooks",
"token_count": 3380
} | 154 |
<jupyter_start><jupyter_text>The Annotated Diffusion Model nielsr Niels Rogge kashif Kashif Rasul In this blog post, we'll take a deeper look into **Denoising Diffusion Probabilistic Models** (also known as D... | notebooks/examples/annotated_diffusion.ipynb/0 | {
"file_path": "notebooks/examples/annotated_diffusion.ipynb",
"repo_id": "notebooks",
"token_count": 16579
} | 155 |
<jupyter_start><jupyter_text>**Fine-tuning for Image Classification with 🤗 Transformers**This notebook shows how to fine-tune any pretrained Vision model for Image Classification on a custom dataset. The idea is to add a randomly initialized classification head on top of a pre-trained encoder, and fine-tune the model ... | notebooks/examples/image_classification-tf.ipynb/0 | {
"file_path": "notebooks/examples/image_classification-tf.ipynb",
"repo_id": "notebooks",
"token_count": 9526
} | 156 |
<jupyter_start><jupyter_text>Fine-tunining DeBERTa model on a question answering task with ORTTrainer In this notebook, we will see how to fine-tune the [DeBERTa base](https://huggingface.co/microsoft/deberta-base/tree/main) model to a question answering task, which is the task of extracting the answer to a question fr... | notebooks/examples/question_answering_ort.ipynb/0 | {
"file_path": "notebooks/examples/question_answering_ort.ipynb",
"repo_id": "notebooks",
"token_count": 10005
} | 157 |
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. We will also use the `seqeval` library to compute some evaluation metrics. Uncomment the following cell and run it.<jupyter_code>#! pip install transformers
#! pip install datasets
#... | notebooks/examples/token_classification-tf.ipynb/0 | {
"file_path": "notebooks/examples/token_classification-tf.ipynb",
"repo_id": "notebooks",
"token_count": 9592
} | 158 |
import argparse
import logging
import os
import sys
import tensorflow as tf
from datasets import load_dataset
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification, DataCollatorWithPadding, create_optimizer
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# Hyperparamete... | notebooks/sagemaker/02_getting_started_tensorflow/scripts/train.py/0 | {
"file_path": "notebooks/sagemaker/02_getting_started_tensorflow/scripts/train.py",
"repo_id": "notebooks",
"token_count": 1677
} | 159 |
base_job_name: accelerate-sagemaker-1
compute_environment: AMAZON_SAGEMAKER
distributed_type: DATA_PARALLEL
ec2_instance_type: ml.p3.16xlarge
iam_role_name: xxxxx
image_uri: null
mixed_precision: fp16
num_machines: 1
profile: xxxxx
py_version: py38
pytorch_version: 1.10.2
region: us-east-1
transformers_version: 4.17.0
... | notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/accelerate_config.yaml/0 | {
"file_path": "notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/accelerate_config.yaml",
"repo_id": "notebooks",
"token_count": 138
} | 160 |
<jupyter_start><jupyter_text>Efficient Large Language Model training with LoRA and Hugging FaceIn this sagemaker example, we are going to learn how to apply [Low-Rank Adaptation of Large Language Models (LoRA)](https://arxiv.org/abs/2106.09685) to fine-tune BLOOMZ (7 billion parameter version instruction tuned version ... | notebooks/sagemaker/24_train_bloom_peft_lora/sagemaker-notebook.ipynb/0 | {
"file_path": "notebooks/sagemaker/24_train_bloom_peft_lora/sagemaker-notebook.ipynb",
"repo_id": "notebooks",
"token_count": 4824
} | 161 |
<jupyter_start><jupyter_text>Deploy Zephyr 7B on AWS Inferentia2 using Amazon SageMakerThis tutorial will show how easy it is to deploy Zephyr 7B on AWS Infernetia2 using Amazon SageMaker. Zephyr is a 7B parameter LLM fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) th... | notebooks/sagemaker/29_deploy_llms_on_inferentia2/sagemaker-notebook.ipynb/0 | {
"file_path": "notebooks/sagemaker/29_deploy_llms_on_inferentia2/sagemaker-notebook.ipynb",
"repo_id": "notebooks",
"token_count": 3797
} | 162 |
<!--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/ia3.md/0 | {
"file_path": "peft/docs/source/conceptual_guides/ia3.md",
"repo_id": "peft",
"token_count": 1030
} | 163 |
<!--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... | peft/docs/source/task_guides/ia3.md/0 | {
"file_path": "peft/docs/source/task_guides/ia3.md",
"repo_id": "peft",
"token_count": 3197
} | 164 |
<jupyter_start><jupyter_code>from transformers import AutoModelForSeq2SeqLM
from peft import get_peft_config, get_peft_model, get_peft_model_state_dict, LoraConfig, TaskType
import torch
from datasets import load_dataset
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from transformers import AutoTokenizer
fr... | peft/examples/conditional_generation/peft_lora_seq2seq.ipynb/0 | {
"file_path": "peft/examples/conditional_generation/peft_lora_seq2seq.ipynb",
"repo_id": "peft",
"token_count": 2336
} | 165 |
<jupyter_start><jupyter_text>Fine-tune large models using 🤗 `peft` adapters, `transformers` & `bitsandbytes`In this tutorial we will cover how we can fine-tune large language models using the very recent `peft` library and `bitsandbytes` for loading large models in 8-bit.The fine-tuning method will rely on a recent me... | peft/examples/int8_training/Finetune_opt_bnb_peft.ipynb/0 | {
"file_path": "peft/examples/int8_training/Finetune_opt_bnb_peft.ipynb",
"repo_id": "peft",
"token_count": 2755
} | 166 |
<jupyter_start><jupyter_text>This notebook shows how to use the adapter merging methods from `peft` and apply them image generation models using `diffusers`. Turn `diffusers` LoRA checkpoints into `PeftModel`<jupyter_code>!pip install diffusers accelerate transformers -U -q
!pip install git+https://github.com/huggingf... | peft/examples/multi_adapter_examples/multi_adapter_weighted_inference_diffusers.ipynb/0 | {
"file_path": "peft/examples/multi_adapter_examples/multi_adapter_weighted_inference_diffusers.ipynb",
"repo_id": "peft",
"token_count": 1802
} | 167 |
# 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/peft_model.py/0 | {
"file_path": "peft/src/peft/peft_model.py",
"repo_id": "peft",
"token_count": 40773
} | 168 |
# 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/config.py/0 | {
"file_path": "peft/src/peft/tuners/ia3/config.py",
"repo_id": "peft",
"token_count": 1842
} | 169 |
# 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/gptq.py/0 | {
"file_path": "peft/src/peft/tuners/lora/gptq.py",
"repo_id": "peft",
"token_count": 1708
} | 170 |
# 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/model.py/0 | {
"file_path": "peft/src/peft/tuners/p_tuning/model.py",
"repo_id": "peft",
"token_count": 2476
} | 171 |
# 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/loftq_utils.py/0 | {
"file_path": "peft/src/peft/utils/loftq_utils.py",
"repo_id": "peft",
"token_count": 4002
} | 172 |
# 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_gpu_examples.py/0 | {
"file_path": "peft/tests/test_gpu_examples.py",
"repo_id": "peft",
"token_count": 36913
} | 173 |
# Recent Changes
### Feb 7, 2023
* New inference benchmark numbers added in [results](results/) folder.
* Add convnext LAION CLIP trained weights and initial set of in1k fine-tunes
* `convnext_base.clip_laion2b_augreg_ft_in1k` - 86.2% @ 256x256
* `convnext_base.clip_laiona_augreg_ft_in1k_384` - 86.5% @ 384x384
*... | pytorch-image-models/docs/changes.md/0 | {
"file_path": "pytorch-image-models/docs/changes.md",
"repo_id": "pytorch-image-models",
"token_count": 29802
} | 174 |
# Dual Path Network (DPN)
A **Dual Path Network (DPN)** is a convolutional neural network which presents a new topology of connection paths internally. The intuition is that [ResNets](https://paperswithcode.com/method/resnet) enables feature re-usage while DenseNet enables new feature exploration, and both are importa... | pytorch-image-models/docs/models/.templates/models/dpn.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/dpn.md",
"repo_id": "pytorch-image-models",
"token_count": 2889
} | 175 |
# Inception v3
**Inception v3** is a convolutional neural network architecture from the Inception family that makes several improvements including using [Label Smoothing](https://paperswithcode.com/method/label-smoothing), Factorized 7 x 7 convolutions, and the use of an [auxiliary classifer](https://paperswithcode.co... | pytorch-image-models/docs/models/.templates/models/inception-v3.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/inception-v3.md",
"repo_id": "pytorch-image-models",
"token_count": 1082
} | 176 |
# ResNeSt
A **ResNeSt** is a variant on a [ResNet](https://paperswithcode.com/method/resnet), which instead stacks [Split-Attention blocks](https://paperswithcode.com/method/split-attention). The cardinal group representations are then concatenated along the channel dimension: $V = \text{Concat}${$V^{1},V^{2},\cdots{V... | pytorch-image-models/docs/models/.templates/models/resnest.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/resnest.md",
"repo_id": "pytorch-image-models",
"token_count": 4643
} | 177 |
# (Tensorflow) EfficientNet Lite
**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... | pytorch-image-models/docs/models/.templates/models/tf-efficientnet-lite.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/tf-efficientnet-lite.md",
"repo_id": "pytorch-image-models",
"token_count": 2543
} | 178 |
# Sharing and Loading Models From the Hugging Face Hub
The `timm` library has a built-in integration with the Hugging Face Hub, making it easy to share and load models from the 🤗 Hub.
In this short guide, we'll see how to:
1. Share a `timm` model on the Hub
2. How to load that model back from the Hub
## Authent... | pytorch-image-models/hfdocs/source/hf_hub.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/hf_hub.mdx",
"repo_id": "pytorch-image-models",
"token_count": 594
} | 179 |
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "timm"
authors = [
{name = "Ross Wightman", email = "ross@huggingface.co"},
]
description = "PyTorch Image Models"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["pytorch", "image-classification"]
license = {text =... | pytorch-image-models/pyproject.toml/0 | {
"file_path": "pytorch-image-models/pyproject.toml",
"repo_id": "pytorch-image-models",
"token_count": 797
} | 180 |
import numpy as np
import pandas as pd
results = {
'results-imagenet.csv': [
'results-imagenet-real.csv',
'results-imagenetv2-matched-frequency.csv',
'results-sketch.csv'
],
'results-imagenet-a-clean.csv': [
'results-imagenet-a.csv',
],
'results-imagenet-r-clean.csv... | pytorch-image-models/results/generate_csv_results.py/0 | {
"file_path": "pytorch-image-models/results/generate_csv_results.py",
"repo_id": "pytorch-image-models",
"token_count": 1346
} | 181 |
from .version import __version__
from .layers import is_scriptable, is_exportable, set_scriptable, set_exportable
from .models import create_model, list_models, list_pretrained, is_model, list_modules, model_entrypoint, \
is_model_pretrained, get_pretrained_cfg, get_pretrained_cfg_value
| pytorch-image-models/timm/__init__.py/0 | {
"file_path": "pytorch-image-models/timm/__init__.py",
"repo_id": "pytorch-image-models",
"token_count": 91
} | 182 |
from .reader_factory import create_reader
from .img_extensions import *
| pytorch-image-models/timm/data/readers/__init__.py/0 | {
"file_path": "pytorch-image-models/timm/data/readers/__init__.py",
"repo_id": "pytorch-image-models",
"token_count": 20
} | 183 |
""" Transforms Factory
Factory methods for building image transforms for use with TIMM (PyTorch Image Models)
Hacked together by / Copyright 2019, Ross Wightman
"""
import math
from typing import Optional, Tuple, Union
import torch
from torchvision import transforms
from timm.data.constants import IMAGENET_DEFAULT_M... | pytorch-image-models/timm/data/transforms_factory.py/0 | {
"file_path": "pytorch-image-models/timm/data/transforms_factory.py",
"repo_id": "pytorch-image-models",
"token_count": 8112
} | 184 |
""" Activation Factory
Hacked together by / Copyright 2020 Ross Wightman
"""
from typing import Union, Callable, Type
from .activations import *
from .activations_jit import *
from .activations_me import *
from .config import is_exportable, is_scriptable, is_no_jit
# PyTorch has an optimized, native 'silu' (aka 'swis... | pytorch-image-models/timm/layers/create_act.py/0 | {
"file_path": "pytorch-image-models/timm/layers/create_act.py",
"repo_id": "pytorch-image-models",
"token_count": 2445
} | 185 |
""" Layer/Module Helpers
Hacked together by / Copyright 2020 Ross Wightman
"""
from itertools import repeat
import collections.abc
# From PyTorch internals
def _ntuple(n):
def parse(x):
if isinstance(x, collections.abc.Iterable) and not isinstance(x, str):
return tuple(x)
return tuple... | pytorch-image-models/timm/layers/helpers.py/0 | {
"file_path": "pytorch-image-models/timm/layers/helpers.py",
"repo_id": "pytorch-image-models",
"token_count": 462
} | 186 |
""" Position Embedding Utilities
Hacked together by / Copyright 2022 Ross Wightman
"""
import logging
import math
from typing import List, Tuple, Optional, Union
import torch
import torch.nn.functional as F
from .helpers import to_2tuple
_logger = logging.getLogger(__name__)
def resample_abs_pos_embed(
po... | pytorch-image-models/timm/layers/pos_embed.py/0 | {
"file_path": "pytorch-image-models/timm/layers/pos_embed.py",
"repo_id": "pytorch-image-models",
"token_count": 1127
} | 187 |
""" Binary Cross Entropy w/ a few extras
Hacked together by / Copyright 2021 Ross Wightman
"""
from typing import Optional, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
class BinaryCrossEntropy(nn.Module):
""" BCE with optional one-hot from dense targets, label smoothing, thresholdin... | pytorch-image-models/timm/loss/binary_cross_entropy.py/0 | {
"file_path": "pytorch-image-models/timm/loss/binary_cross_entropy.py",
"repo_id": "pytorch-image-models",
"token_count": 1082
} | 188 |
""" DeiT - Data-efficient Image Transformers
DeiT model defs and weights from https://github.com/facebookresearch/deit, original copyright below
paper: `DeiT: Data-efficient Image Transformers` - https://arxiv.org/abs/2012.12877
paper: `DeiT III: Revenge of the ViT` - https://arxiv.org/abs/2204.07118
Modifications ... | pytorch-image-models/timm/models/deit.py/0 | {
"file_path": "pytorch-image-models/timm/models/deit.py",
"repo_id": "pytorch-image-models",
"token_count": 8300
} | 189 |
""" Global Context ViT
From scratch implementation of GCViT in the style of timm swin_transformer_v2_cr.py
Global Context Vision Transformers -https://arxiv.org/abs/2206.09959
@article{hatamizadeh2022global,
title={Global Context Vision Transformers},
author={Hatamizadeh, Ali and Yin, Hongxu and Kautz, Jan and M... | pytorch-image-models/timm/models/gcvit.py/0 | {
"file_path": "pytorch-image-models/timm/models/gcvit.py",
"repo_id": "pytorch-image-models",
"token_count": 10789
} | 190 |
""" MobileNet V3
A PyTorch impl of MobileNet-V3, compatible with TF weights from official impl.
Paper: Searching for MobileNetV3 - https://arxiv.org/abs/1905.02244
Hacked together by / Copyright 2019, Ross Wightman
"""
from functools import partial
from typing import Callable, List, Optional, Tuple
import torch
imp... | pytorch-image-models/timm/models/mobilenetv3.py/0 | {
"file_path": "pytorch-image-models/timm/models/mobilenetv3.py",
"repo_id": "pytorch-image-models",
"token_count": 17103
} | 191 |
"""PyTorch ResNet
This started as a copy of https://github.com/pytorch/vision 'resnet.py' (BSD-3-Clause) with
additional dropout and dynamic global avg/max pool.
ResNeXt, SE-ResNeXt, SENet, and MXNet Gluon stem/downsample variants, tiered stems added by Ross Wightman
Copyright 2019, Ross Wightman
"""
import math
fro... | pytorch-image-models/timm/models/resnet.py/0 | {
"file_path": "pytorch-image-models/timm/models/resnet.py",
"repo_id": "pytorch-image-models",
"token_count": 44237
} | 192 |
""" Vision Transformer (ViT) in PyTorch
A PyTorch implement of Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers`
- https:... | pytorch-image-models/timm/models/vision_transformer.py/0 | {
"file_path": "pytorch-image-models/timm/models/vision_transformer.py",
"repo_id": "pytorch-image-models",
"token_count": 58282
} | 193 |
""" PyTorch Lamb optimizer w/ behaviour similar to NVIDIA FusedLamb
This optimizer code was adapted from the following (starting with latest)
* https://github.com/HabanaAI/Model-References/blob/2b435114fe8e31f159b1d3063b8280ae37af7423/PyTorch/nlp/bert/pretraining/lamb.py
* https://github.com/NVIDIA/DeepLearningExample... | pytorch-image-models/timm/optim/lamb.py/0 | {
"file_path": "pytorch-image-models/timm/optim/lamb.py",
"repo_id": "pytorch-image-models",
"token_count": 3768
} | 194 |
""" Plateau Scheduler
Adapts PyTorch plateau scheduler and allows application of noise, warmup.
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
from .scheduler import Scheduler
class PlateauLRScheduler(Scheduler):
"""Decay the LR by a factor every time the validation loss plateaus."""
d... | pytorch-image-models/timm/scheduler/plateau_lr.py/0 | {
"file_path": "pytorch-image-models/timm/scheduler/plateau_lr.py",
"repo_id": "pytorch-image-models",
"token_count": 1800
} | 195 |
""" Misc utils
Hacked together by / Copyright 2020 Ross Wightman
"""
import argparse
import ast
import re
def natural_key(string_):
"""See http://www.codinghorror.com/blog/archives/001018.html"""
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_.lower())]
def add_bool_arg(parser, nam... | pytorch-image-models/timm/utils/misc.py/0 | {
"file_path": "pytorch-image-models/timm/utils/misc.py",
"repo_id": "pytorch-image-models",
"token_count": 451
} | 196 |
[package]
name = "text-generation-benchmark"
description = "Text Generation Benchmarking tool"
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
[lib]
path = "src/lib.rs"
[[bin]]
name = "text-generation-benchmark"
path = "src/main.rs"
[dependencies]
average = "0.14"... | text-generation-inference/benchmark/Cargo.toml/0 | {
"file_path": "text-generation-inference/benchmark/Cargo.toml",
"repo_id": "text-generation-inference",
"token_count": 381
} | 197 |
from text_generation.errors import (
parse_error,
GenerationError,
IncompleteGenerationError,
OverloadedError,
ValidationError,
BadRequestError,
ShardNotReadyError,
ShardTimeoutError,
NotFoundError,
RateLimitExceededError,
UnknownError,
)
def test_generation_error():
pa... | text-generation-inference/clients/python/tests/test_errors.py/0 | {
"file_path": "text-generation-inference/clients/python/tests/test_errors.py",
"repo_id": "text-generation-inference",
"token_count": 598
} | 198 |
# Using TGI CLI
You can use TGI command-line interface (CLI) to download weights, serve and quantize models, or get information on serving parameters. To install the CLI, please refer to [the installation section](../installation#install-cli).
`text-generation-server` lets you download the model with `download-weight... | text-generation-inference/docs/source/basic_tutorials/using_cli.md/0 | {
"file_path": "text-generation-inference/docs/source/basic_tutorials/using_cli.md",
"repo_id": "text-generation-inference",
"token_count": 323
} | 199 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 15,
"logprob": null,
"text": ","
},
{
"id": 1669,
"logprob": -5.4414062,
"text": " il"
},
{
"id": 1158... | text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m_all_params.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m_all_params.json",
"repo_id": "text-generation-inference",
"token_count": 1199
} | 200 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 50278,
"logprob": null,
"text": "<|USER|>"
},
{
"id": 1276,
"logprob": -4.5546875,
"text": "What"
},
{
... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json",
"repo_id": "text-generation-inference",
"token_count": 1353
} | 201 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 60,
"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_default_params.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder2/test_flash_starcoder2_default_params.json",
"repo_id": "text-generation-inference",
"token_count": 4754
} | 202 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 50278,
"logprob": null,
"text": "<|USER|>"
},
{
"id": 1276,
"logprob": -4.5546875,
"text": "What"
},
{
... | text-generation-inference/integration-tests/models/__snapshots__/test_neox/test_neox.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_neox/test_neox.json",
"repo_id": "text-generation-inference",
"token_count": 1351
} | 203 |
import pytest
@pytest.fixture(scope="module")
def flash_gemma_handle(launcher):
with launcher("gg-hf/gemma-2b", num_shard=1) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_gemma(flash_gemma_handle):
await flash_gemma_handle.health(300)
return flash_gemma_handle.client
... | text-generation-inference/integration-tests/models/test_flash_gemma.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_gemma.py",
"repo_id": "text-generation-inference",
"token_count": 679
} | 204 |
import pytest
@pytest.fixture(scope="module")
def fused_kernel_mamba_handle(launcher):
with launcher("state-spaces/mamba-130m", num_shard=1) as handle:
yield handle
@pytest.fixture(scope="module")
async def fused_kernel_mamba(fused_kernel_mamba_handle):
await fused_kernel_mamba_handle.health(300)
... | text-generation-inference/integration-tests/models/test_mamba.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_mamba.py",
"repo_id": "text-generation-inference",
"token_count": 772
} | 205 |
import {check} from 'k6';
import http from 'k6/http';
import {Trend} from 'k6/metrics';
const host = __ENV.HOST || '127.0.0.1:3000';
const totalTime = new Trend('total_time', true);
const validationTime = new Trend('validation_time', true);
const queueTime = new Trend('queue_time', true);
const inferenceTime = new Tr... | text-generation-inference/load_tests/starcoder_load.js/0 | {
"file_path": "text-generation-inference/load_tests/starcoder_load.js",
"repo_id": "text-generation-inference",
"token_count": 836
} | 206 |
/// Batching and inference logic
use crate::validation::{Validation, ValidationError};
use crate::{
ChatTemplateInputs, Entry, GenerateRequest, GenerateStreamResponse, HubTokenizerConfig,
Message, PrefillToken, Queue, Token,
};
use futures::future::try_join_all;
use minijinja::{Environment, ErrorKind, Template}... | text-generation-inference/router/src/infer.rs/0 | {
"file_path": "text-generation-inference/router/src/infer.rs",
"repo_id": "text-generation-inference",
"token_count": 19043
} | 207 |
# Text Generation Inference Python gRPC Server
A Python gRPC server for Text Generation Inference
## Install
```shell
make install
```
## Run
```shell
make run-dev
```
| text-generation-inference/server/README.md/0 | {
"file_path": "text-generation-inference/server/README.md",
"repo_id": "text-generation-inference",
"token_count": 56
} | 208 |
// Adapted from turboderp exllama: https://github.com/turboderp/exllama
#ifndef _tuning_h
#define _tuning_h
struct ExLlamaTuning
{
int matmul_recons_thd;
bool matmul_fused_remap;
bool matmul_no_half2;
};
#endif
| text-generation-inference/server/exllama_kernels/exllama_kernels/tuning.h/0 | {
"file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/tuning.h",
"repo_id": "text-generation-inference",
"token_count": 106
} | 209 |
#ifndef _qdq_5_cuh
#define _qdq_5_cuh
#include "qdq_util.cuh"
#include "../../config.h"
#if QMODE_5BIT == 1
// Permutation:
//
// v5555533 33311111 u4444422 22200000 (u, v lsb)
// vbbbbb99 99977777 uaaaaa88 88866666
// vhhhhhff fffddddd ugggggee eeeccccc
// vnnnnnll llljjjjj ummmmmkk kkkiiiii
// vtttttrr rrrppp... | text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh/0 | {
"file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh",
"repo_id": "text-generation-inference",
"token_count": 4272
} | 210 |
import pytest
from text_generation_server.pb import generate_pb2
from text_generation_server.models.causal_lm import CausalLMBatch
from text_generation_server.models.santacoder import SantaCoder
@pytest.fixture(scope="session")
def default_santacoder():
return SantaCoder("bigcode/santacoder")
@pytest.fixture
d... | text-generation-inference/server/tests/models/test_santacoder.py/0 | {
"file_path": "text-generation-inference/server/tests/models/test_santacoder.py",
"repo_id": "text-generation-inference",
"token_count": 1306
} | 211 |
# coding=utf-8
# Copyright 2022 HuggingFace Inc. team and BigScience workshop.
#
# 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 re... | text-generation-inference/server/text_generation_server/models/custom_modeling/bloom_modeling.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/bloom_modeling.py",
"repo_id": "text-generation-inference",
"token_count": 16214
} | 212 |
import torch
import torch.distributed
from opentelemetry import trace
from transformers import AutoTokenizer, AutoConfig
from typing import Optional, List
import json
import os
from huggingface_hub import hf_hub_download
from text_generation_server.models import FlashCausalLM
from text_generation_server.models.custom... | text-generation-inference/server/text_generation_server/models/flash_santacoder.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/flash_santacoder.py",
"repo_id": "text-generation-inference",
"token_count": 1324
} | 213 |
from functools import total_ordering
import torch
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import List, Optional
from transformers import PreTrainedTokenizerBase
from text_generation_server.pb import generate_pb2
from text_generation_server.pb.generate_pb2 import FinishReason... | text-generation-inference/server/text_generation_server/models/types.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/types.py",
"repo_id": "text-generation-inference",
"token_count": 1228
} | 214 |
import torch
IS_ROCM_SYSTEM = torch.version.hip is not None
IS_CUDA_SYSTEM = torch.version.cuda is not None
| text-generation-inference/server/text_generation_server/utils/import_utils.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/utils/import_utils.py",
"repo_id": "text-generation-inference",
"token_count": 40
} | 215 |
{
"name": "tokenizers-darwin-arm64",
"version": "0.13.4-rc1",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"main": "tokenizers.darwin-arm64.node",
"files": [
"tokenizers.darwin-arm64.node"
],
"description": "Tokenizers platform specific bindings",
"keywords": [
"napi-rs",
"NAPI",
... | tokenizers/bindings/node/npm/darwin-arm64/package.json/0 | {
"file_path": "tokenizers/bindings/node/npm/darwin-arm64/package.json",
"repo_id": "tokenizers",
"token_count": 268
} | 216 |
{
"name": "tokenizers-win32-arm64-msvc",
"version": "0.13.4-rc1",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"main": "tokenizers.win32-arm64-msvc.node",
"files": [
"tokenizers.win32-arm64-msvc.node"
],
"description": "Tokenizers platform specific bindings",
"keywords": [
"napi-rs",
... | tokenizers/bindings/node/npm/win32-arm64-msvc/package.json/0 | {
"file_path": "tokenizers/bindings/node/npm/win32-arm64-msvc/package.json",
"repo_id": "tokenizers",
"token_count": 277
} | 217 |
extern crate tokenizers as tk;
use crate::models::Model;
use napi::bindgen_prelude::*;
use std::sync::{Arc, RwLock};
use tokenizers::models::bpe::{BpeBuilder, BPE};
use tokenizers::models::wordlevel::{WordLevel, WordLevelBuilder};
use tokenizers::models::wordpiece::{WordPiece, WordPieceBuilder};
pub struct BPEFromFil... | tokenizers/bindings/node/src/tasks/models.rs/0 | {
"file_path": "tokenizers/bindings/node/src/tasks/models.rs",
"repo_id": "tokenizers",
"token_count": 800
} | 218 |
from typing import List
import jieba
from tokenizers import NormalizedString, PreTokenizedString, Regex, Tokenizer
from tokenizers.decoders import Decoder
from tokenizers.models import BPE
from tokenizers.normalizers import Normalizer
from tokenizers.pre_tokenizers import PreTokenizer
class JiebaPreTokenizer:
de... | tokenizers/bindings/python/examples/custom_components.py/0 | {
"file_path": "tokenizers/bindings/python/examples/custom_components.py",
"repo_id": "tokenizers",
"token_count": 1293
} | 219 |
import json
import os
from typing import Iterator, List, Optional, Union, Tuple
from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers
from tokenizers.models import Unigram
from .base_tokenizer import BaseTokenizer
class SentencePieceUnigramTokenizer(BaseTokenizer):
... | tokenizers/bindings/python/py_src/tokenizers/implementations/sentencepiece_unigram.py/0 | {
"file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/sentencepiece_unigram.py",
"repo_id": "tokenizers",
"token_count": 3351
} | 220 |
import transformers
from tokenizers.implementations import SentencePieceUnigramTokenizer, BaseTokenizer
from tokenizers.processors import TemplateProcessing
from tokenizers.models import Unigram, BPE
from tokenizers import decoders
from tokenizers import Tokenizer, Regex
from tokenizers.normalizers import (
StripAc... | tokenizers/bindings/python/scripts/convert.py/0 | {
"file_path": "tokenizers/bindings/python/scripts/convert.py",
"repo_id": "tokenizers",
"token_count": 6302
} | 221 |
use pyo3::exceptions;
use pyo3::prelude::*;
use pyo3::types::*;
use std::marker::PhantomData;
use std::sync::{Arc, Mutex};
mod iterators;
mod normalization;
mod pretokenization;
mod regex;
pub use iterators::*;
pub use normalization::*;
pub use pretokenization::*;
pub use regex::*;
// PyChar
// This type is a tempor... | tokenizers/bindings/python/src/utils/mod.rs/0 | {
"file_path": "tokenizers/bindings/python/src/utils/mod.rs",
"repo_id": "tokenizers",
"token_count": 1057
} | 222 |
# Training from memory
In the [Quicktour](quicktour), we saw how to build and train a
tokenizer using text files, but we can actually use any Python Iterator.
In this section we'll see a few different ways of training our
tokenizer.
For all the examples listed below, we'll use the same [`~tokenizers.Tokenizer`] and
[... | tokenizers/docs/source-doc-builder/training_from_memory.mdx/0 | {
"file_path": "tokenizers/docs/source-doc-builder/training_from_memory.mdx",
"repo_id": "tokenizers",
"token_count": 1199
} | 223 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | tokenizers/docs/source/conf.py/0 | {
"file_path": "tokenizers/docs/source/conf.py",
"repo_id": "tokenizers",
"token_count": 781
} | 224 |
#[macro_use]
extern crate criterion;
mod common;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;
use criterion::Criterion;
use tokenizers::models::wordpiece::{WordPiece, WordPieceTrainerBuilder};
use tokenizers::normalizers::{BertNormalizer, NormalizerWrapper};
use tokenizers::pre_tokenize... | tokenizers/tokenizers/benches/bert_benchmark.rs/0 | {
"file_path": "tokenizers/tokenizers/benches/bert_benchmark.rs",
"repo_id": "tokenizers",
"token_count": 1642
} | 225 |
use crate::tokenizer::{Decoder, Result};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Clone, Debug, Serialize)]
/// The WordPiece decoder takes care of decoding a list of wordpiece tokens
/// back into a readable string.
#[serde(tag = "type")]
#[non_exhaustive]
pub struct WordPiece {
/// The prefix ... | tokenizers/tokenizers/src/decoders/wordpiece.rs/0 | {
"file_path": "tokenizers/tokenizers/src/decoders/wordpiece.rs",
"repo_id": "tokenizers",
"token_count": 1275
} | 226 |
use super::WordLevel;
use crate::utils::parallelism::*;
use crate::{AddedToken, Result, Trainer};
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::HashMap;
#[non_exhaustive]
#[derive(Debug, Clone, Builder, Serialize, Deserialize)]
pub struct WordLevelTrainer {
/// The minimum freq... | tokenizers/tokenizers/src/models/wordlevel/trainer.rs/0 | {
"file_path": "tokenizers/tokenizers/src/models/wordlevel/trainer.rs",
"repo_id": "tokenizers",
"token_count": 2735
} | 227 |
use crate::tokenizer::{Decoder, PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior};
use serde::{Deserialize, Deserializer, Serialize};
/// Enum representing options for the metaspace prepending scheme.
#[derive(Debug, Clone, PartialEq, Serialize, Eq, Deserialize, Copy)]
#[serde(rename_all = "snake_case"... | tokenizers/tokenizers/src/pre_tokenizers/metaspace.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/metaspace.rs",
"repo_id": "tokenizers",
"token_count": 6508
} | 228 |
//! Represents a tokenization pipeline.
//!
//! A [`Tokenizer`](struct.Tokenizer.html) is composed of some of the following parts.
//! - [`Normalizer`](trait.Normalizer.html): Takes care of the text normalization (like unicode normalization).
//! - [`PreTokenizer`](trait.PreTokenizer.html): Takes care of the pre to... | tokenizers/tokenizers/src/tokenizer/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/src/tokenizer/mod.rs",
"repo_id": "tokenizers",
"token_count": 18666
} | 229 |
use tokenizers::decoders::wordpiece::WordPiece as WordPieceDecoder;
use tokenizers::models::bpe::BPE;
use tokenizers::models::wordpiece::WordPiece;
use tokenizers::normalizers::bert::BertNormalizer;
use tokenizers::pre_tokenizers::bert::BertPreTokenizer;
use tokenizers::pre_tokenizers::byte_level::ByteLevel;
use tokeni... | tokenizers/tokenizers/tests/common/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/tests/common/mod.rs",
"repo_id": "tokenizers",
"token_count": 771
} | 230 |
apiVersion: v1
kind: PersistentVolume
metadata:
name: huggingface-cluster-disk
spec:
storageClassName: ""
capacity:
storage: 500Gi
accessModes:
- ReadOnlyMany
claimRef:
namespace: default
name: huggingface-cluster-disk-claim
gcePersistentDisk:
pdName: huggingface-cluster-disk
fsType:... | transformers/docker/transformers-pytorch-tpu/dataset.yaml/0 | {
"file_path": "transformers/docker/transformers-pytorch-tpu/dataset.yaml",
"repo_id": "transformers",
"token_count": 274
} | 231 |
<!---
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/de/installation.md/0 | {
"file_path": "transformers/docs/source/de/installation.md",
"repo_id": "transformers",
"token_count": 3999
} | 232 |
<!--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/fast_tokenizers.md/0 | {
"file_path": "transformers/docs/source/en/fast_tokenizers.md",
"repo_id": "transformers",
"token_count": 792
} | 233 |
<!--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/bartpho.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/bartpho.md",
"repo_id": "transformers",
"token_count": 1166
} | 234 |
<!--Copyright 2023 The Intel Labs Team Authors, The Microsoft Research Team Authors and HuggingFace Inc. 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... | transformers/docs/source/en/model_doc/bridgetower.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/bridgetower.md",
"repo_id": "transformers",
"token_count": 2392
} | 235 |
<!--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/cpm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/cpm.md",
"repo_id": "transformers",
"token_count": 735
} | 236 |
<!--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/flan-t5.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/flan-t5.md",
"repo_id": "transformers",
"token_count": 781
} | 237 |
<!--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/gpt_neox.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/gpt_neox.md",
"repo_id": "transformers",
"token_count": 1662
} | 238 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.