text
stringlengths
5
424k
id
stringlengths
13
178
metadata
dict
__index_level_0__
int64
0
672
# Generated content DO NOT EDIT class PreTokenizer: """ Base class for all pre-tokenizers This class is not supposed to be instantiated directly. Instead, any implementation of a PreTokenizer will return an instance of this class when instantiated. """ def pre_tokenize(self, pretok): ""...
tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.pyi/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.pyi", "repo_id": "tokenizers", "token_count": 10983 }
369
use pyo3::exceptions; use pyo3::prelude::*; use pyo3::type_object::PyTypeInfo; use std::ffi::CString; use std::fmt::{Display, Formatter, Result as FmtResult}; use tokenizers::tokenizer::Result; #[derive(Debug)] pub struct PyError(pub String); impl PyError { #[allow(dead_code)] pub fn from(s: &str) -> Self { ...
tokenizers/bindings/python/src/error.rs/0
{ "file_path": "tokenizers/bindings/python/src/error.rs", "repo_id": "tokenizers", "token_count": 545 }
370
from tokenizers import Tokenizer, decoders, models, normalizers, pre_tokenizers, processors from tokenizers.implementations import BaseTokenizer class TestBaseTokenizer: def test_get_set_components(self): toki = Tokenizer(models.BPE()) toki.normalizer = normalizers.NFC() toki.pre_tokenizer...
tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py/0
{ "file_path": "tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py", "repo_id": "tokenizers", "token_count": 550 }
371
# Normalizers <tokenizerslangcontent> <python> ## ByteLevel [[autodoc]] tokenizers.normalizers.ByteLevel ## Lowercase [[autodoc]] tokenizers.normalizers.Lowercase ## NFC [[autodoc]] tokenizers.normalizers.NFC ## NFD [[autodoc]] tokenizers.normalizers.NFD ## NFKC [[autodoc]] tokenizers.normalizers.NFKC ## NF...
tokenizers/docs/source-doc-builder/api/normalizers.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/api/normalizers.mdx", "repo_id": "tokenizers", "token_count": 373 }
372
🤗 Tokenizers is tested on Python 3.5+. You should install 🤗 Tokenizers in a `virtual environment <https://docs.python.org/3/library/venv.html>`_. If you're unfamiliar with Python virtual environments, check out the `user guide <https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`__. C...
tokenizers/docs/source/installation/python.inc/0
{ "file_path": "tokenizers/docs/source/installation/python.inc", "repo_id": "tokenizers", "token_count": 383 }
373
#[macro_use] extern crate criterion; mod common; use common::iter_bench_train; use criterion::{Criterion, Throughput}; use tokenizers::models::unigram::{Unigram, UnigramTrainerBuilder}; use tokenizers::models::TrainerWrapper; use tokenizers::pre_tokenizers::whitespace::Whitespace; use tokenizers::Tokenizer; // pub ...
tokenizers/tokenizers/benches/unigram_benchmark.rs/0
{ "file_path": "tokenizers/tokenizers/benches/unigram_benchmark.rs", "repo_id": "tokenizers", "token_count": 951 }
374
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello wasm-pack!</title> </head> <body> <noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript> <script src="./bootstrap.js"></script> </body> </html>
tokenizers/tokenizers/examples/unstable_wasm/www/index.html/0
{ "file_path": "tokenizers/tokenizers/examples/unstable_wasm/www/index.html", "repo_id": "tokenizers", "token_count": 110 }
375
use super::{super::OrderedVocabIter, trainer::BpeTrainer, Error, Pair, Word}; use crate::tokenizer::{Model, Result, Token}; use crate::utils::cache::{Cache, DEFAULT_CACHE_CAPACITY, MAX_LENGTH}; use crate::utils::iter::ResultShunt; use ahash::AHashMap; use serde_json::Value; use std::borrow::Cow; use std::collections::...
tokenizers/tokenizers/src/models/bpe/model.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/bpe/model.rs", "repo_id": "tokenizers", "token_count": 17796 }
376
use std::collections::HashSet; use super::WordPiece; use crate::models::bpe::{BpeTrainer, BpeTrainerBuilder, BPE}; use crate::tokenizer::{AddedToken, Result, Trainer}; use ahash::AHashSet; use serde::{Deserialize, Serialize}; /// A `WordPieceTrainerBuilder` can be used to create a `WordPieceTrainer` with a custom ///...
tokenizers/tokenizers/src/models/wordpiece/trainer.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/wordpiece/trainer.rs", "repo_id": "tokenizers", "token_count": 2559 }
377
pub mod bert; pub mod byte_level; pub mod delimiter; pub mod digits; pub mod fixed_length; pub mod metaspace; pub mod punctuation; pub mod sequence; pub mod split; pub mod unicode_scripts; pub mod whitespace; use serde::{Deserialize, Deserializer, Serialize}; use crate::pre_tokenizers::bert::BertPreTokenizer; use cra...
tokenizers/tokenizers/src/pre_tokenizers/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/pre_tokenizers/mod.rs", "repo_id": "tokenizers", "token_count": 6852 }
378
use crate::pattern::Pattern; use crate::{Offsets, Result}; use std::ops::{Bound, RangeBounds}; use unicode_normalization_alignments::UnicodeNormalization; use serde::{Deserialize, Serialize}; /// The possible offsets referential #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum OffsetReferential { Original, ...
tokenizers/tokenizers/src/tokenizer/normalizer.rs/0
{ "file_path": "tokenizers/tokenizers/src/tokenizer/normalizer.rs", "repo_id": "tokenizers", "token_count": 43150 }
379
use std::iter::FromIterator; use ahash::AHashMap; use tokenizers::decoders::byte_fallback::ByteFallback; use tokenizers::models::bpe::{BpeTrainerBuilder, BPE}; use tokenizers::normalizers::{Sequence, Strip, NFC}; use tokenizers::pre_tokenizers::byte_level::ByteLevel; use tokenizers::{AddedToken, TokenizerBuilder}; use...
tokenizers/tokenizers/tests/documentation.rs/0
{ "file_path": "tokenizers/tokenizers/tests/documentation.rs", "repo_id": "tokenizers", "token_count": 8476 }
380
{ "overrides": [ { "files": ["tests/**/*.js"], "options": { "printWidth": 10000000 } } ] }
transformers.js/.prettierrc/0
{ "file_path": "transformers.js/.prettierrc", "repo_id": "transformers.js", "token_count": 108 }
381
# Use custom models <include> { "path": "../snippets/4_custom-usage.snippet" } </include>
transformers.js/docs/source/custom_usage.md/0
{ "file_path": "transformers.js/docs/source/custom_usage.md", "repo_id": "transformers.js", "token_count": 40 }
382
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Adaptive Retrieval w/ Transformers.js</title> </head> <body> <div id="root"></div> <scr...
transformers.js/examples/adaptive-retrieval/index.html/0
{ "file_path": "transformers.js/examples/adaptive-retrieval/index.html", "repo_id": "transformers.js", "token_count": 162 }
383
export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
transformers.js/examples/code-completion/postcss.config.js/0
{ "file_path": "transformers.js/examples/code-completion/postcss.config.js", "repo_id": "transformers.js", "token_count": 35 }
384
#root { height: 100vh; width: 100vw; padding: 1rem; }
transformers.js/examples/cross-encoder/src/App.css/0
{ "file_path": "transformers.js/examples/cross-encoder/src/App.css", "repo_id": "transformers.js", "token_count": 29 }
385
import './style.css'; import * as THREE from 'three'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { pipeline, env, RawImage } from '@xenova/transformers'; // Since we will download the model from the Hugging Face Hub, we can skip the local model check env.allowLocalModels = false; ...
transformers.js/examples/depth-anything-client/main.js/0
{ "file_path": "transformers.js/examples/depth-anything-client/main.js", "repo_id": "transformers.js", "token_count": 1584 }
386
{ "name": "florence2-webgpu", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, "dependencies": { "@xenova/transform...
transformers.js/examples/florence2-webgpu/package.json/0
{ "file_path": "transformers.js/examples/florence2-webgpu/package.json", "repo_id": "transformers.js", "token_count": 418 }
387
#root { max-width: 960px; height: 100vh; margin: 0 auto; text-align: center; display: flex; justify-content: center; align-items: center; }
transformers.js/examples/musicgen-web/src/App.css/0
{ "file_path": "transformers.js/examples/musicgen-web/src/App.css", "repo_id": "transformers.js", "token_count": 60 }
388
* { box-sizing: border-box; padding: 0; margin: 0; font-family: sans-serif; } html, body { height: 100%; } body { padding: 16px 32px; } body, #container, #upload-button { display: flex; flex-direction: column; justify-content: center; align-items: center; } h1, h4 { text-align: center; } h4 {...
transformers.js/examples/remove-background-client/style.css/0
{ "file_path": "transformers.js/examples/remove-background-client/style.css", "repo_id": "transformers.js", "token_count": 422 }
389
import { env, AutoTokenizer, ClapTextModelWithProjection } from '@xenova/transformers'; import { getCachedFile } from './utils'; // Skip local model check env.allowLocalModels = false; class ApplicationSingleton { static model_id = 'Xenova/larger_clap_music_and_speech'; static BASE_URL = 'https://huggingface...
transformers.js/examples/semantic-audio-search/worker.js/0
{ "file_path": "transformers.js/examples/semantic-audio-search/worker.js", "repo_id": "transformers.js", "token_count": 1294 }
390
import './globals.css' import { Inter } from 'next/font/google' const inter = Inter({ subsets: ['latin'] }) export const metadata = { title: 'In-browser Semantic Image Search', description: 'Search for images using text (built w/ Transformers.js)', } export default function RootLayout({ children }) { return ( ...
transformers.js/examples/semantic-image-search-client/src/app/layout.js/0
{ "file_path": "transformers.js/examples/semantic-image-search-client/src/app/layout.js", "repo_id": "transformers.js", "token_count": 139 }
391
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Transformers.js - Text-to-speech demo</title> </head> <body> <div id="root"></div> <script type="module" src="/src/main.jsx"></script> </body> </ht...
transformers.js/examples/text-to-speech-client/index.html/0
{ "file_path": "transformers.js/examples/text-to-speech-client/index.html", "repo_id": "transformers.js", "token_count": 136 }
392
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>The Tokenizer Playground</title> </head> <body> <div id="root"></div> <script type="module" src="/src/main.jsx"></script> </body> </html>
transformers.js/examples/tokenizer-playground/index.html/0
{ "file_path": "transformers.js/examples/tokenizer-playground/index.html", "repo_id": "transformers.js", "token_count": 117 }
393
import { marked } from 'marked'; import DOMPurify from 'dompurify'; import BotIcon from './icons/BotIcon'; import UserIcon from './icons/UserIcon'; import './Chat.css'; export default function Chat({ messages }) { const empty = messages.length === 0; return (<div className={`flex-1 p-6 max-w-[960px] w-full ...
transformers.js/examples/webgpu-chat/src/components/Chat.jsx/0
{ "file_path": "transformers.js/examples/webgpu-chat/src/components/Chat.jsx", "repo_id": "transformers.js", "token_count": 1362 }
394
import { defineConfig } from 'vite'; export default defineConfig({ build: { target: 'esnext' } });
transformers.js/examples/webgpu-clip/vite.config.js/0
{ "file_path": "transformers.js/examples/webgpu-clip/vite.config.js", "repo_id": "transformers.js", "token_count": 37 }
395
{ "name": "webgpu-video-depth-estimation", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "devDependencies": { "vite": "^5.2.0" }, "dependencies": { "@xenova/transformers": "github:xenova/transf...
transformers.js/examples/webgpu-video-depth-estimation/package.json/0
{ "file_path": "transformers.js/examples/webgpu-video-depth-estimation/package.json", "repo_id": "transformers.js", "token_count": 157 }
396
export default function BotIcon(props) { return ( <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" stroke...
transformers.js/examples/webgpu-vlm/src/components/icons/BotIcon.jsx/0
{ "file_path": "transformers.js/examples/webgpu-vlm/src/components/icons/BotIcon.jsx", "repo_id": "transformers.js", "token_count": 392 }
397
import random from typing import Optional, Tuple from optimum.exporters.onnx.config import TextDecoderOnnxConfig from optimum.utils import NormalizedTextConfig, DummyInputGenerator, DEFAULT_DUMMY_SHAPES, DummyTextInputGenerator, NormalizedConfig class OpenElmDummyPastKeyValuesGenerator(DummyInputGenerator): SUPP...
transformers.js/scripts/extra/openelm.py/0
{ "file_path": "transformers.js/scripts/extra/openelm.py", "repo_id": "transformers.js", "token_count": 1129 }
398
/** * @module generation/configuration_utils */ import { pick } from "../utils/core.js"; /** * Class that holds a configuration for a generation task. */ export class GenerationConfig { // Parameters that control the length of the output /** * The maximum length the generated tokens can have. *...
transformers.js/src/generation/configuration_utils.js/0
{ "file_path": "transformers.js/src/generation/configuration_utils.js", "repo_id": "transformers.js", "token_count": 4706 }
399
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class ConvNextImageProcessor extends ImageProcessor { constructor(config) { super(config); /** * Percentage of the image to crop. Only has an effect if this.size < 384. */ // @ts-expect-er...
transformers.js/src/models/convnext/image_processing_convnext.js/0
{ "file_path": "transformers.js/src/models/convnext/image_processing_convnext.js", "repo_id": "transformers.js", "token_count": 683 }
400
import { ImageProcessor, } from "../../base/image_processors_utils.js"; import { cat, full, interpolate_4d, slice, stack } from "../../utils/tensor.js"; export class Idefics3ImageProcessor extends ImageProcessor { constructor(config) { super(config); this.do_image_splitting = config.do_image...
transformers.js/src/models/idefics3/image_processing_idefics3.js/0
{ "file_path": "transformers.js/src/models/idefics3/image_processing_idefics3.js", "repo_id": "transformers.js", "token_count": 4603 }
401
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class MobileViTImageProcessor extends ImageProcessor { } export class MobileViTFeatureExtractor extends MobileViTImageProcessor { }
transformers.js/src/models/mobilevit/image_processing_mobilevit.js/0
{ "file_path": "transformers.js/src/models/mobilevit/image_processing_mobilevit.js", "repo_id": "transformers.js", "token_count": 64 }
402
import { ImageProcessor, post_process_object_detection, } from "../../base/image_processors_utils.js"; export class RTDetrImageProcessor extends ImageProcessor { /** @type {typeof post_process_object_detection} */ post_process_object_detection(...args) { return post_process_object_detection(....
transformers.js/src/models/rt_detr/image_processing_rt_detr.js/0
{ "file_path": "transformers.js/src/models/rt_detr/image_processing_rt_detr.js", "repo_id": "transformers.js", "token_count": 122 }
403
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class VitPoseImageProcessor extends ImageProcessor { /** * Transform the heatmaps into keypoint predictions and transform them back to the image. * NOTE: This is a naive implementation and does not include advanced post-p...
transformers.js/src/models/vitpose/image_processing_vitpose.js/0
{ "file_path": "transformers.js/src/models/vitpose/image_processing_vitpose.js", "repo_id": "transformers.js", "token_count": 1796 }
404
export const GITHUB_ISSUE_URL = 'https://github.com/huggingface/transformers.js/issues/new/choose'; export const CONFIG_NAME = "config.json" export const FEATURE_EXTRACTOR_NAME = "preprocessor_config.json" export const IMAGE_PROCESSOR_NAME = FEATURE_EXTRACTOR_NAME export const PROCESSOR_NAME = "processor_config.json"...
transformers.js/src/utils/constants.js/0
{ "file_path": "transformers.js/src/utils/constants.js", "repo_id": "transformers.js", "token_count": 149 }
405
// Helper functions used when initialising the testing environment. // Import Node typing utilities import * as types from "node:util/types"; // Import onnxruntime-node's default backend import { onnxruntimeBackend } from "onnxruntime-node/dist/backend"; import * as ONNX_COMMON from "onnxruntime-common"; /** * A wo...
transformers.js/tests/init.js/0
{ "file_path": "transformers.js/tests/init.js", "repo_id": "transformers.js", "token_count": 2091 }
406
import { CodeGenTokenizer, CodeGenForCausalLM } from "../../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; export default () => { describe("CodeGenForCausalLM", () => { const model_id = "hf-internal-testing/ti...
transformers.js/tests/models/codegen/test_modeling_codegen.js/0
{ "file_path": "transformers.js/tests/models/codegen/test_modeling_codegen.js", "repo_id": "transformers.js", "token_count": 768 }
407
import { PreTrainedTokenizer, JAISLMHeadModel } from "../../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; export default () => { describe("JAISLMHeadModel", () => { const model_id = "onnx-community/tiny-rando...
transformers.js/tests/models/jais/test_modeling_jais.js/0
{ "file_path": "transformers.js/tests/models/jais/test_modeling_jais.js", "repo_id": "transformers.js", "token_count": 798 }
408
import { Wav2Vec2Processor, MoonshineForConditionalGeneration, full, ones } from "../../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; export default () => { describe("MoonshineForConditionalGeneration", () => { ...
transformers.js/tests/models/moonshine/test_modeling_moonshine.js/0
{ "file_path": "transformers.js/tests/models/moonshine/test_modeling_moonshine.js", "repo_id": "transformers.js", "token_count": 724 }
409
import { AutoProcessor, AutoModelForAudioFrameClassification } from "../../../src/transformers.js"; import { MAX_TEST_EXECUTION_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; import { compare } from "../../test_utils.js"; export default () => { const models_to_test = ["onnx-community/pyannote-segmentation-3.0"...
transformers.js/tests/models/pyannote/test_modeling_pyannote.js/0
{ "file_path": "transformers.js/tests/models/pyannote/test_modeling_pyannote.js", "repo_id": "transformers.js", "token_count": 1018 }
410
import { AutoImageProcessor, rand, Tensor, VitPoseImageProcessor } from "../../../src/transformers.js"; import { load_cached_image } from "../../asset_cache.js"; import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js"; export default () => { describe("VitPoseImageProcessor", () => { con...
transformers.js/tests/models/vitpose/test_image_processing_vitpose.js/0
{ "file_path": "transformers.js/tests/models/vitpose/test_image_processing_vitpose.js", "repo_id": "transformers.js", "token_count": 725 }
411
import { pipeline, FillMaskPipeline } from "../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js"; const PIPELINE_ID = "fill-mask"; export default () => { describe("Fill Mask", () => { describe("Standard", () => { ...
transformers.js/tests/pipelines/test_pipelines_fill_mask.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_fill_mask.js", "repo_id": "transformers.js", "token_count": 3763 }
412
import { pipeline, ZeroShotAudioClassificationPipeline } from "../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js"; import { load_cached_audio } from "../asset_cache.js"; const PIPELINE_ID = "zero-shot-audio-classificatio...
transformers.js/tests/pipelines/test_pipelines_zero_shot_audio_classification.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_zero_shot_audio_classification.js", "repo_id": "transformers.js", "token_count": 827 }
413
import { fileURLToPath } from "node:url"; import path from "node:path"; import fs from "node:fs"; import webpack from "webpack"; import TerserPlugin from "terser-webpack-plugin"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); /** * Plugin to strip the "node:" prefix from module requests. * * This...
transformers.js/webpack.config.js/0
{ "file_path": "transformers.js/webpack.config.js", "repo_id": "transformers.js", "token_count": 2352 }
414
# AGENTS.md Guide for Hugging Face Transformers This AGENTS.md file provides guidance for code agents working with this codebase. ## Core Project Structure - `/src/transformers`: This contains the core source code for the library - `/models`: Code for individual models. Models inherit from base classes in the root...
transformers/AGENTS.md/0
{ "file_path": "transformers/AGENTS.md", "repo_id": "transformers", "token_count": 833 }
415
defaults: - benchmark # inheriting benchmark schema - scenario: inference - launcher: process - backend: pytorch - _self_ # for hydra 1.1 compatibility name: pytorch_generate launcher: start_method: spawn device_isolation: true device_isolation_action: warn backend: device: cuda device_ids: 0 n...
transformers/benchmark/config/generation.yaml/0
{ "file_path": "transformers/benchmark/config/generation.yaml", "repo_id": "transformers", "token_count": 449 }
416
FROM python:3.10-slim ENV PYTHONDONTWRITEBYTECODE=1 USER root ARG REF=main RUN apt-get update && apt-get install -y time git g++ pkg-config make git-lfs ENV UV_PYTHON=/usr/local/bin/python RUN pip install uv && uv pip install --no-cache-dir -U pip setuptools GitPython RUN uv pip install --no-cache-dir --upgrade 'torch'...
transformers/docker/consistency.dockerfile/0
{ "file_path": "transformers/docker/consistency.dockerfile", "repo_id": "transformers", "token_count": 278 }
417
FROM google/cloud-sdk:slim # Build args. ARG GITHUB_REF=refs/heads/main # TODO: This Dockerfile installs pytorch/xla 3.6 wheels. There are also 3.7 # wheels available; see below. ENV PYTHON_VERSION=3.6 RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ ...
transformers/docker/transformers-pytorch-tpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-pytorch-tpu/Dockerfile", "repo_id": "transformers", "token_count": 1235 }
418
# النماذج متعددة اللغات للاستدلال هناك العديد من النماذج متعددة اللغات في مكتبة 🤗 Transformers، وتختلف طريقة استخدامها للاستدلال عن النماذج أحادية اللغة. ولكن ليس كل استخدام النماذج متعددة اللغات مختلف. فبعض النماذج، مثل [google-bert/bert-base-multilingual-uncased](https://huggingface.co/google-bert/bert-base-multili...
transformers/docs/source/ar/multilingual.md/0
{ "file_path": "transformers/docs/source/ar/multilingual.md", "repo_id": "transformers", "token_count": 4876 }
419
<!--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/ar/tasks/multiple_choice.md/0
{ "file_path": "transformers/docs/source/ar/tasks/multiple_choice.md", "repo_id": "transformers", "token_count": 5876 }
420
<!--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/de/add_new_model.md/0
{ "file_path": "transformers/docs/source/de/add_new_model.md", "repo_id": "transformers", "token_count": 23972 }
421
# docstyle-ignore INSTALL_CONTENT = """ # Transformers installation ! pip install transformers datasets evaluate accelerate # To install from source instead of the last release, comment the command above and uncomment the following one. # ! pip install git+https://github.com/huggingface/transformers.git """ notebook_f...
transformers/docs/source/en/_config.py/0
{ "file_path": "transformers/docs/source/en/_config.py", "repo_id": "transformers", "token_count": 157 }
422
<!--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/hpo_train.md/0
{ "file_path": "transformers/docs/source/en/hpo_train.md", "repo_id": "transformers", "token_count": 2488 }
423
<!--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/kv_cache.md/0
{ "file_path": "transformers/docs/source/en/kv_cache.md", "repo_id": "transformers", "token_count": 5358 }
424
<!--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/main_classes/output.md/0
{ "file_path": "transformers/docs/source/en/main_classes/output.md", "repo_id": "transformers", "token_count": 1670 }
425
<!--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/audio-spectrogram-transformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md", "repo_id": "transformers", "token_count": 2370 }
426
<!--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/biogpt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/biogpt.md", "repo_id": "transformers", "token_count": 1809 }
427
<!--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": 827 }
428
<!--Copyright 2025 Deepseek AI and 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 applicab...
transformers/docs/source/en/model_doc/deepseek_vl_hybrid.md/0
{ "file_path": "transformers/docs/source/en/model_doc/deepseek_vl_hybrid.md", "repo_id": "transformers", "token_count": 2939 }
429
<!--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/distilbert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/distilbert.md", "repo_id": "transformers", "token_count": 1492 }
430
<!--Copyright 2025 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/ernie4_5.md/0
{ "file_path": "transformers/docs/source/en/model_doc/ernie4_5.md", "repo_id": "transformers", "token_count": 1201 }
431
<!--Copyright 2025 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/florence2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/florence2.md", "repo_id": "transformers", "token_count": 2259 }
432
<!--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/imagegpt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/imagegpt.md", "repo_id": "transformers", "token_count": 2073 }
433
<!--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/led.md/0
{ "file_path": "transformers/docs/source/en/model_doc/led.md", "repo_id": "transformers", "token_count": 2990 }
434
<!--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/longt5.md/0
{ "file_path": "transformers/docs/source/en/model_doc/longt5.md", "repo_id": "transformers", "token_count": 1770 }
435
<!--Copyright 2021 NVIDIA Corporation and 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 a...
transformers/docs/source/en/model_doc/megatron_gpt2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/megatron_gpt2.md", "repo_id": "transformers", "token_count": 1301 }
436
<!--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/mobilenet_v2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mobilenet_v2.md", "repo_id": "transformers", "token_count": 1830 }
437
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Copyright (c) 2024, NVIDIA CORPORATION. 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/lic...
transformers/docs/source/en/model_doc/nemotron.md/0
{ "file_path": "transformers/docs/source/en/model_doc/nemotron.md", "repo_id": "transformers", "token_count": 1873 }
438
<!--Copyright 2024 The Qwen Team and 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 applic...
transformers/docs/source/en/model_doc/qwen3.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qwen3.md", "repo_id": "transformers", "token_count": 504 }
439
<!--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/roc_bert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roc_bert.md", "repo_id": "transformers", "token_count": 1440 }
440
<!--Copyright 2025 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 agree...
transformers/docs/source/en/model_doc/shieldgemma2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/shieldgemma2.md", "repo_id": "transformers", "token_count": 1294 }
441
<!--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/swin.md/0
{ "file_path": "transformers/docs/source/en/model_doc/swin.md", "repo_id": "transformers", "token_count": 1248 }
442
<!--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/transfo-xl.md/0
{ "file_path": "transformers/docs/source/en/model_doc/transfo-xl.md", "repo_id": "transformers", "token_count": 1889 }
443
<!--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/wav2vec2-conformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/wav2vec2-conformer.md", "repo_id": "transformers", "token_count": 1199 }
444
<!--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/perf_hardware.md/0
{ "file_path": "transformers/docs/source/en/perf_hardware.md", "repo_id": "transformers", "token_count": 1237 }
445
<!--- 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 ...
transformers/docs/source/en/pr_checks.md/0
{ "file_path": "transformers/docs/source/en/pr_checks.md", "repo_id": "transformers", "token_count": 3159 }
446
<!--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/quantization/hqq.md/0
{ "file_path": "transformers/docs/source/en/quantization/hqq.md", "repo_id": "transformers", "token_count": 1296 }
447
<!--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/tasks/audio_classification.md/0
{ "file_path": "transformers/docs/source/en/tasks/audio_classification.md", "repo_id": "transformers", "token_count": 4000 }
448
<!--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/tasks/object_detection.md/0
{ "file_path": "transformers/docs/source/en/tasks/object_detection.md", "repo_id": "transformers", "token_count": 23688 }
449
### `tiny-agents` CLI and MCP Tools To showcase the use of MCP tools, let's see how to integrate the `transformers serve` server with the [`tiny-agents`](https://huggingface.co/blog/python-tiny-agents) CLI. > [!TIP] > Many Hugging Face Spaces can be used as MCP servers, as in this example. You can find all compatible...
transformers/docs/source/en/tiny_agents.md/0
{ "file_path": "transformers/docs/source/en/tiny_agents.md", "repo_id": "transformers", "token_count": 699 }
450
<!--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/es/chat_templating.md/0
{ "file_path": "transformers/docs/source/es/chat_templating.md", "repo_id": "transformers", "token_count": 8513 }
451
<!--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/es/pipeline_tutorial.md/0
{ "file_path": "transformers/docs/source/es/pipeline_tutorial.md", "repo_id": "transformers", "token_count": 6255 }
452
<!--⚠️ 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. --> # Pipelines pour l'inférence L'objet [`pipeline`] rend simple l'utilisation de n'importe quel modèle du [Hub](https://huggingface.co/models) pour l'...
transformers/docs/source/fr/tutoriel_pipeline.md/0
{ "file_path": "transformers/docs/source/fr/tutoriel_pipeline.md", "repo_id": "transformers", "token_count": 6224 }
453
<!--- 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/it/installation.md/0
{ "file_path": "transformers/docs/source/it/installation.md", "repo_id": "transformers", "token_count": 3586 }
454
<!--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/it/quicktour.md/0
{ "file_path": "transformers/docs/source/it/quicktour.md", "repo_id": "transformers", "token_count": 5364 }
455
<!--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/ja/generation_strategies.md/0
{ "file_path": "transformers/docs/source/ja/generation_strategies.md", "repo_id": "transformers", "token_count": 7779 }
456
<!--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/ja/model_doc/albert.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/albert.md", "repo_id": "transformers", "token_count": 2497 }
457
<!--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/ja/model_doc/bigbird_pegasus.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/bigbird_pegasus.md", "repo_id": "transformers", "token_count": 2276 }
458
<!--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/ja/model_doc/clip.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/clip.md", "repo_id": "transformers", "token_count": 4289 }
459
<!--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/ja/model_doc/decision_transformer.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/decision_transformer.md", "repo_id": "transformers", "token_count": 1069 }
460
<!--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/ja/perf_infer_gpu_many.md/0
{ "file_path": "transformers/docs/source/ja/perf_infer_gpu_many.md", "repo_id": "transformers", "token_count": 2559 }
461
<!-- 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 agree...
transformers/docs/source/ja/preprocessing.md/0
{ "file_path": "transformers/docs/source/ja/preprocessing.md", "repo_id": "transformers", "token_count": 12127 }
462
<!--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/ja/tasks/multiple_choice.md/0
{ "file_path": "transformers/docs/source/ja/tasks/multiple_choice.md", "repo_id": "transformers", "token_count": 4283 }
463
<!--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/ja/torchscript.md/0
{ "file_path": "transformers/docs/source/ja/torchscript.md", "repo_id": "transformers", "token_count": 4350 }
464
<!--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/ko/deepspeed.md/0
{ "file_path": "transformers/docs/source/ko/deepspeed.md", "repo_id": "transformers", "token_count": 43913 }
465
<!--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/ko/main_classes/optimizer_schedules.md/0
{ "file_path": "transformers/docs/source/ko/main_classes/optimizer_schedules.md", "repo_id": "transformers", "token_count": 905 }
466
<!--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/ko/model_doc/bert-japanese.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/bert-japanese.md", "repo_id": "transformers", "token_count": 1393 }
467
<!--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/ko/model_doc/mamba.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/mamba.md", "repo_id": "transformers", "token_count": 3979 }
468