text
stringlengths
5
424k
id
stringlengths
13
178
metadata
dict
__index_level_0__
int64
0
672
use crate::parallelism::*; use crate::tokenizer::{Offsets, Token}; use crate::utils::padding::PaddingDirection; use crate::utils::truncation::TruncationDirection; use ahash::AHashMap; use serde::{Deserialize, Serialize}; use std::ops::Range; /// Represents the output of a `Tokenizer`. #[derive(Default, PartialEq, Debu...
tokenizers/tokenizers/src/tokenizer/encoding.rs/0
{ "file_path": "tokenizers/tokenizers/src/tokenizer/encoding.rs", "repo_id": "tokenizers", "token_count": 17200 }
319
mod common; use common::*; use tokenizers::tokenizer::AddedToken; #[test] fn add_tokens() { let mut tokenizer = get_empty(); assert_eq!( tokenizer.add_special_tokens(&[ AddedToken::from("<cls>", true), AddedToken::from("<sep>", true) ]), 2 ); assert_eq!...
tokenizers/tokenizers/tests/added_tokens.rs/0
{ "file_path": "tokenizers/tokenizers/tests/added_tokens.rs", "repo_id": "tokenizers", "token_count": 1770 }
320
- local: index title: 🤗 Transformers.js - sections: - local: installation title: Installation - local: pipelines title: The pipeline API - local: custom_usage title: Custom usage title: Get started - sections: - local: tutorials/vanilla-js title: Building a Vanilla JS Application - local:...
transformers.js/docs/source/_toctree.yml/0
{ "file_path": "transformers.js/docs/source/_toctree.yml", "repo_id": "transformers.js", "token_count": 825 }
321
{ "name": "code-completion", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "code-completion", "version": "0.0.0", "dependencies": { "@monaco-editor/react": "^4.5.1", "@xenova/transformers": "^2.4.4", "react": "^18.2.0", ...
transformers.js/examples/code-completion/package-lock.json/0
{ "file_path": "transformers.js/examples/code-completion/package-lock.json", "repo_id": "transformers.js", "token_count": 69198 }
322
// This file (model.js) contains all the logic for loading the model and running predictions. class MyClassificationPipeline { // NOTE: Replace this with your own task and model static task = 'text-classification'; static model = 'Xenova/distilbert-base-uncased-finetuned-sst-2-english'; static instance...
transformers.js/examples/electron/src/model.js/0
{ "file_path": "transformers.js/examples/electron/src/model.js", "repo_id": "transformers.js", "token_count": 366 }
323
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
transformers.js/examples/next-client/postcss.config.js/0
{ "file_path": "transformers.js/examples/next-client/postcss.config.js", "repo_id": "transformers.js", "token_count": 38 }
324
{ "name": "esm", "version": "1.0.0", "description": "Server-side inference with Transformers.js (ESM)", "type": "module", "main": "app.js", "keywords": [], "author": "Xenova", "license": "ISC", "dependencies": { "@xenova/transformers": "^2.0.0" } }
transformers.js/examples/node/esm/package.json/0
{ "file_path": "transformers.js/examples/node/esm/package.json", "repo_id": "transformers.js", "token_count": 116 }
325
@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap'); * { box-sizing: border-box; padding: 0; margin: 0; font-family: 'Montserrat', sans-serif; } html { background: radial-gradient(ellipse at center, #1b2735 0%, #090a0f 100%); height: 100%; width: 100%; } body { overflow: h...
transformers.js/examples/semantic-audio-search/style.css/0
{ "file_path": "transformers.js/examples/semantic-audio-search/style.css", "repo_id": "transformers.js", "token_count": 707 }
326
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
transformers.js/examples/semantic-image-search/postcss.config.js/0
{ "file_path": "transformers.js/examples/semantic-image-search/postcss.config.js", "repo_id": "transformers.js", "token_count": 38 }
327
import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.6.0'; // Since we will download the model from the Hugging Face Hub, we can skip the local model check env.allowLocalModels = false; // Reference the elements that we will need const status = document.getElementById('status'); const fi...
transformers.js/examples/vanilla-js/index.js/0
{ "file_path": "transformers.js/examples/vanilla-js/index.js", "repo_id": "transformers.js", "token_count": 817 }
328
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Transformers.js | Real-time depth estimation</title> </head> <body> <h1> Real-time depth estimation w/ <a href="https://huggingface.co/onnx-community/depth-a...
transformers.js/examples/webgpu-video-depth-estimation/index.html/0
{ "file_path": "transformers.js/examples/webgpu-video-depth-estimation/index.html", "repo_id": "transformers.js", "token_count": 534 }
329
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Whisper Timestamped</title> </head> <body> <div id="root"></div> <script type="module" src="/src/main.jsx"></script> </body> </html>
transformers.js/examples/whisper-word-timestamps/index.html/0
{ "file_path": "transformers.js/examples/whisper-word-timestamps/index.html", "repo_id": "transformers.js", "token_count": 130 }
330
from transformers.convert_slow_tokenizer import Converter from tokenizers import Tokenizer, pre_tokenizers, processors from tokenizers.models import WordPiece class EsmConverter(Converter): def converted(self) -> Tokenizer: vocab = self.original_tokenizer.vocab tokenizer = Tokenizer(WordPiece(voca...
transformers.js/scripts/extra/esm.py/0
{ "file_path": "transformers.js/scripts/extra/esm.py", "repo_id": "transformers.js", "token_count": 1055 }
331
/** * @file Helper module for using model configs. For more information, see the corresponding * [Python documentation](https://huggingface.co/docs/transformers/main/en/model_doc/auto#transformers.AutoConfig). * * **Example:** Load an `AutoConfig`. * * ```javascript * import { AutoConfig } from '@huggingface/...
transformers.js/src/configs.js/0
{ "file_path": "transformers.js/src/configs.js", "repo_id": "transformers.js", "token_count": 8201 }
332
import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js'; import { Tensor } from '../../utils/tensor.js'; import { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js'; export class ClapFeatureExtractor extends FeatureExtractor { constructor(config) ...
transformers.js/src/models/clap/feature_extraction_clap.js/0
{ "file_path": "transformers.js/src/models/clap/feature_extraction_clap.js", "repo_id": "transformers.js", "token_count": 3003 }
333
import { ImageProcessor, } from "../../base/image_processors_utils.js"; import { ones } from '../../utils/tensor.js'; /** * @typedef {object} GroundingDinoFeatureExtractorResultProps * @property {import('../../utils/tensor.js').Tensor} pixel_mask * @typedef {import('../../base/image_processors_utils.js').Ima...
transformers.js/src/models/grounding_dino/image_processing_grounding_dino.js/0
{ "file_path": "transformers.js/src/models/grounding_dino/image_processing_grounding_dino.js", "repo_id": "transformers.js", "token_count": 385 }
334
import { ImageProcessor, } from "../../base/image_processors_utils.js"; import { cat, Tensor } from "../../utils/tensor.js"; export class Qwen2VLImageProcessor extends ImageProcessor { async _call(images, ...args) { const { pixel_values, original_sizes, reshaped_input_sizes } = await super._call(images...
transformers.js/src/models/qwen2_vl/image_processing_qwen2_vl.js/0
{ "file_path": "transformers.js/src/models/qwen2_vl/image_processing_qwen2_vl.js", "repo_id": "transformers.js", "token_count": 888 }
335
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class ViTImageProcessor extends ImageProcessor { } export class ViTFeatureExtractor extends ViTImageProcessor { }
transformers.js/src/models/vit/image_processing_vit.js/0
{ "file_path": "transformers.js/src/models/vit/image_processing_vit.js", "repo_id": "transformers.js", "token_count": 61 }
336
/** * @file Entry point for the Transformers.js library. Only the exports from this file * are available to the end user, and are grouped as follows: * * 1. [Pipelines](./pipelines) * 2. [Environment variables](./env) * 3. [Models](./models) * 4. [Tokenizers](./tokenizers) * 5. [Processors](./processors) * ...
transformers.js/src/transformers.js/0
{ "file_path": "transformers.js/src/transformers.js", "repo_id": "transformers.js", "token_count": 556 }
337
import { init } from "./init.js"; import { collect_and_execute_tests } from "./test_utils.js"; init(); await collect_and_execute_tests("Feature extractors", "feature_extraction");
transformers.js/tests/feature_extractors.test.js/0
{ "file_path": "transformers.js/tests/feature_extractors.test.js", "repo_id": "transformers.js", "token_count": 57 }
338
import { AutoTokenizer, AutoProcessor, load_image, CLIPVisionModelWithProjection, CLIPTextModelWithProjection } from "../../../src/transformers.js"; import { MAX_TEST_EXECUTION_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; export default () => { const models_to_test = ["hf-internal-testing/tiny-random-CLIPMod...
transformers.js/tests/models/clip/test_modeling_clip.js/0
{ "file_path": "transformers.js/tests/models/clip/test_modeling_clip.js", "repo_id": "transformers.js", "token_count": 787 }
339
import { AutoImageProcessor, Idefics3ImageProcessor } 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 () => { // Idefics3ImageProcessor // - custom image processing (patc...
transformers.js/tests/models/idefics3/test_image_processing_idefics3.js/0
{ "file_path": "transformers.js/tests/models/idefics3/test_image_processing_idefics3.js", "repo_id": "transformers.js", "token_count": 1918 }
340
import { AutoImageProcessor, Phi3VImageProcessor } from "../../../src/transformers.js"; import { load_cached_image } from "../../asset_cache.js"; import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js"; const TARGET_IMAGE_SIZE = [3, 336, 336]; export default () => { // Phi3VImageProcessor ...
transformers.js/tests/models/phi3_v/test_image_processing_phi3_v.js/0
{ "file_path": "transformers.js/tests/models/phi3_v/test_image_processing_phi3_v.js", "repo_id": "transformers.js", "token_count": 1634 }
341
import { pipeline, DocumentQuestionAnsweringPipeline, RawImage } 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 = "document-question-answering"; export default () => { describe("Document Q...
transformers.js/tests/pipelines/test_pipelines_document_question_answering.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_document_question_answering.js", "repo_id": "transformers.js", "token_count": 571 }
342
import { pipeline, TranslationPipeline } 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 = "translation"; export default () => { describe("Translation", () => { const model_id = "Xenova...
transformers.js/tests/pipelines/test_pipelines_translation.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_translation.js", "repo_id": "transformers.js", "token_count": 607 }
343
import { AutoProcessor, hamming, hanning, mel_filter_bank } from "../../src/transformers.js"; import { getFile } from "../../src/utils/hub.js"; import { RawImage } from "../../src/utils/image.js"; import { MAX_TEST_EXECUTION_TIME } from "../init.js"; import { compare } from "../test_utils.js"; describe("Utilities", (...
transformers.js/tests/utils/utils.test.js/0
{ "file_path": "transformers.js/tests/utils/utils.test.js", "repo_id": "transformers.js", "token_count": 1769 }
344
# 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 applicabl...
transformers/benchmark/benchmark.py/0
{ "file_path": "transformers/benchmark/benchmark.py", "repo_id": "transformers", "token_count": 5437 }
345
# 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 applicabl...
transformers/conftest.py/0
{ "file_path": "transformers/conftest.py", "repo_id": "transformers", "token_count": 1881 }
346
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-11.html#rel-23-11 FROM nvcr.io/nvidia/pytorch:24.08-py3 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Example: `cu102`, `cu113`, etc. ARG CUDA='cu126' RUN apt -y update RUN apt install -y libaio-dev RUN python3 -m p...
transformers/docker/transformers-pytorch-deepspeed-nightly-gpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-pytorch-deepspeed-nightly-gpu/Dockerfile", "repo_id": "transformers", "token_count": 1118 }
347
# BERTology يُشهد في الآونة الأخيرة نمو مجال دراسي يُعنى باستكشاف آلية عمل نماذج المحولات الضخمة مثل BERT (والذي يُطلق عليها البعض اسم "BERTology"). ومن الأمثلة البارزة على هذا المجال ما يلي: - BERT Rediscovers the Classical NLP Pipeline بواسطة Ian Tenney و Dipanjan Das و Ellie Pavlick: https://huggingface.co/paper...
transformers/docs/source/ar/bertology.md/0
{ "file_path": "transformers/docs/source/ar/bertology.md", "repo_id": "transformers", "token_count": 973 }
348
<!--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 to...
transformers/docs/source/ar/tasks/language_modeling.md/0
{ "file_path": "transformers/docs/source/ar/tasks/language_modeling.md", "repo_id": "transformers", "token_count": 7256 }
349
- sections: - local: index title: 🤗 Transformers - local: quicktour title: Schnellstart - local: installation title: Installation title: Erste Schritte - sections: - local: pipeline_tutorial title: Pipelines für Inferenzen - local: autoclass_tutorial title: Laden von vortrainierten Inst...
transformers/docs/source/de/_toctree.yml/0
{ "file_path": "transformers/docs/source/de/_toctree.yml", "repo_id": "transformers", "token_count": 430 }
350
<!--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/testing.md/0
{ "file_path": "transformers/docs/source/de/testing.md", "repo_id": "transformers", "token_count": 19213 }
351
<!--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/chat_templating_multimodal.md/0
{ "file_path": "transformers/docs/source/en/chat_templating_multimodal.md", "repo_id": "transformers", "token_count": 3558 }
352
<!--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/glossary.md/0
{ "file_path": "transformers/docs/source/en/glossary.md", "repo_id": "transformers", "token_count": 6743 }
353
<!--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/onnx.md/0
{ "file_path": "transformers/docs/source/en/main_classes/onnx.md", "repo_id": "transformers", "token_count": 523 }
354
<!--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/arcee.md/0
{ "file_path": "transformers/docs/source/en/model_doc/arcee.md", "repo_id": "transformers", "token_count": 1184 }
355
<!--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/big_bird.md/0
{ "file_path": "transformers/docs/source/en/model_doc/big_bird.md", "repo_id": "transformers", "token_count": 1597 }
356
<!--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/canine.md/0
{ "file_path": "transformers/docs/source/en/model_doc/canine.md", "repo_id": "transformers", "token_count": 1300 }
357
<!--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/convnext.md/0
{ "file_path": "transformers/docs/source/en/model_doc/convnext.md", "repo_id": "transformers", "token_count": 1191 }
358
<!--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 to...
transformers/docs/source/en/model_doc/dinov2_with_registers.md/0
{ "file_path": "transformers/docs/source/en/model_doc/dinov2_with_registers.md", "repo_id": "transformers", "token_count": 1072 }
359
<!--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/flava.md/0
{ "file_path": "transformers/docs/source/en/model_doc/flava.md", "repo_id": "transformers", "token_count": 1040 }
360
<!--Copyright 2025 The ZhipuAI Inc. and The 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.org/licenses/LICENSE-2.0 Unless required b...
transformers/docs/source/en/model_doc/glm4v.md/0
{ "file_path": "transformers/docs/source/en/model_doc/glm4v.md", "repo_id": "transformers", "token_count": 2676 }
361
<!--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/granitemoehybrid.md/0
{ "file_path": "transformers/docs/source/en/model_doc/granitemoehybrid.md", "repo_id": "transformers", "token_count": 1232 }
362
<!--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 ag...
transformers/docs/source/en/model_doc/longcat_flash.md/0
{ "file_path": "transformers/docs/source/en/model_doc/longcat_flash.md", "repo_id": "transformers", "token_count": 1644 }
363
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/mobilebert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mobilebert.md", "repo_id": "transformers", "token_count": 1340 }
364
<!--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/opt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/opt.md", "repo_id": "transformers", "token_count": 1707 }
365
<!--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/qwen2_moe.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qwen2_moe.md", "repo_id": "transformers", "token_count": 2020 }
366
<!--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/roberta-prelayernorm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roberta-prelayernorm.md", "repo_id": "transformers", "token_count": 1037 }
367
<!--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/sew-d.md/0
{ "file_path": "transformers/docs/source/en/model_doc/sew-d.md", "repo_id": "transformers", "token_count": 827 }
368
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the MIT License; you may not use this file except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CON...
transformers/docs/source/en/model_doc/superpoint.md/0
{ "file_path": "transformers/docs/source/en/model_doc/superpoint.md", "repo_id": "transformers", "token_count": 1883 }
369
<!--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/model_doc/timm_wrapper.md/0
{ "file_path": "transformers/docs/source/en/model_doc/timm_wrapper.md", "repo_id": "transformers", "token_count": 800 }
370
<!--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/voxtral.md/0
{ "file_path": "transformers/docs/source/en/model_doc/voxtral.md", "repo_id": "transformers", "token_count": 4854 }
371
<!--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/xls_r.md/0
{ "file_path": "transformers/docs/source/en/model_doc/xls_r.md", "repo_id": "transformers", "token_count": 879 }
372
<!--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/pipeline_tutorial.md/0
{ "file_path": "transformers/docs/source/en/pipeline_tutorial.md", "repo_id": "transformers", "token_count": 5405 }
373
<!--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/gptq.md/0
{ "file_path": "transformers/docs/source/en/quantization/gptq.md", "repo_id": "transformers", "token_count": 2618 }
374
<!--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/serving.md/0
{ "file_path": "transformers/docs/source/en/serving.md", "repo_id": "transformers", "token_count": 6633 }
375
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/monocular_depth_estimation.md/0
{ "file_path": "transformers/docs/source/en/tasks/monocular_depth_estimation.md", "repo_id": "transformers", "token_count": 2037 }
376
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/zero_shot_object_detection.md/0
{ "file_path": "transformers/docs/source/en/tasks/zero_shot_object_detection.md", "repo_id": "transformers", "token_count": 4125 }
377
<!--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/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/es/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 1659 }
378
<!--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/es/perplexity.md/0
{ "file_path": "transformers/docs/source/es/perplexity.md", "repo_id": "transformers", "token_count": 3119 }
379
<!--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/tasks/multiple_choice.md/0
{ "file_path": "transformers/docs/source/es/tasks/multiple_choice.md", "repo_id": "transformers", "token_count": 2108 }
380
<!--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/fr/task_summary.md/0
{ "file_path": "transformers/docs/source/fr/task_summary.md", "repo_id": "transformers", "token_count": 8189 }
381
<!--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/it/debugging.md/0
{ "file_path": "transformers/docs/source/it/debugging.md", "repo_id": "transformers", "token_count": 5635 }
382
<!--- 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/it/pr_checks.md/0
{ "file_path": "transformers/docs/source/it/pr_checks.md", "repo_id": "transformers", "token_count": 2370 }
383
<!--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/custom_models.md/0
{ "file_path": "transformers/docs/source/ja/custom_models.md", "repo_id": "transformers", "token_count": 7500 }
384
<!--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/llm_tutorial.md/0
{ "file_path": "transformers/docs/source/ja/llm_tutorial.md", "repo_id": "transformers", "token_count": 5627 }
385
<!--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/main_classes/tokenizer.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/tokenizer.md", "repo_id": "transformers", "token_count": 1908 }
386
<!--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/bertweet.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/bertweet.md", "repo_id": "transformers", "token_count": 1155 }
387
<!--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/chinese_clip.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/chinese_clip.md", "repo_id": "transformers", "token_count": 2277 }
388
<!--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/deberta-v2.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/deberta-v2.md", "repo_id": "transformers", "token_count": 2758 }
389
<!--⚠️ 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. --> # Webサーバー用のパイプラインの使用 <Tip> 推論エンジンの作成は複雑なトピックであり、"最適な"ソリューションはおそらく問題の領域に依存するでしょう。CPUまたはGPUを使用していますか?最低のレイテンシ、最高のスループット、多くのモデルのサポート、または特定のモデルの高度な最適化を望...
transformers/docs/source/ja/pipeline_webserver.md/0
{ "file_path": "transformers/docs/source/ja/pipeline_webserver.md", "repo_id": "transformers", "token_count": 3402 }
390
<!--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/testing.md/0
{ "file_path": "transformers/docs/source/ja/testing.md", "repo_id": "transformers", "token_count": 22630 }
391
<!--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/custom_models.md/0
{ "file_path": "transformers/docs/source/ko/custom_models.md", "repo_id": "transformers", "token_count": 10728 }
392
<!--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/model.md/0
{ "file_path": "transformers/docs/source/ko/main_classes/model.md", "repo_id": "transformers", "token_count": 1417 }
393
<!--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/barthez.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/barthez.md", "repo_id": "transformers", "token_count": 2135 }
394
<!--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/deberta.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/deberta.md", "repo_id": "transformers", "token_count": 4447 }
395
<!--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/ko/model_doc/swin2sr.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/swin2sr.md", "repo_id": "transformers", "token_count": 2504 }
396
<!--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 to...
transformers/docs/source/ko/peft.md/0
{ "file_path": "transformers/docs/source/ko/peft.md", "repo_id": "transformers", "token_count": 5060 }
397
<!--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/quantization/awq.md/0
{ "file_path": "transformers/docs/source/ko/quantization/awq.md", "repo_id": "transformers", "token_count": 7293 }
398
<!--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/tasks/image_feature_extraction.md/0
{ "file_path": "transformers/docs/source/ko/tasks/image_feature_extraction.md", "repo_id": "transformers", "token_count": 3506 }
399
<!--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/ko/tasks/translation.md/0
{ "file_path": "transformers/docs/source/ko/tasks/translation.md", "repo_id": "transformers", "token_count": 7173 }
400
<!--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/pt/custom_models.md/0
{ "file_path": "transformers/docs/source/pt/custom_models.md", "repo_id": "transformers", "token_count": 5914 }
401
<!--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/zh/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/zh/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 2730 }
402
<!--版权所有 2020 年 HuggingFace 团队。保留所有权利。 根据 Apache 许可证 2.0 版本许可,除非符合许可证的规定,否则您不得使用此文件。您可以在以下网址获取许可证的副本: http://www.apache.org/licenses/LICENSE-2.0 除非适用法律要求或书面同意,否则依照许可证分发的软件是基于“原样”提供的,不附带任何明示或暗示的担保或条件。有关特定语言下权限的限制和限制,请参阅许可证。--> # 模型 基类 [`PreTrainedModel`] 实现了从本地文件或目录加载/保存模型的常用方法,或者从库上提供的预训练模型配置(从 HuggingFace 的 AWS S...
transformers/docs/source/zh/main_classes/model.md/0
{ "file_path": "transformers/docs/source/zh/main_classes/model.md", "repo_id": "transformers", "token_count": 3044 }
403
<!--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/zh/perf_torch_compile.md/0
{ "file_path": "transformers/docs/source/zh/perf_torch_compile.md", "repo_id": "transformers", "token_count": 6785 }
404
# 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 applicabl...
transformers/examples/3D_parallel.py/0
{ "file_path": "transformers/examples/3D_parallel.py", "repo_id": "transformers", "token_count": 8103 }
405
#### Fine-tuning BERT on SQuAD1.0 with relative position embeddings The following examples show how to fine-tune BERT models with different relative position embeddings. The BERT model `google-bert/bert-base-uncased` was pretrained with default absolute position embeddings. We provide the following pretrained models...
transformers/examples/legacy/question-answering/README.md/0
{ "file_path": "transformers/examples/legacy/question-answering/README.md", "repo_id": "transformers", "token_count": 1771 }
406
#!/usr/bin/env python # 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...
transformers/examples/legacy/seq2seq/minify_dataset.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/minify_dataset.py", "repo_id": "transformers", "token_count": 398 }
407
# 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 applicabl...
transformers/examples/legacy/seq2seq/sentence_splitter.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/sentence_splitter.py", "repo_id": "transformers", "token_count": 403 }
408
# 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 applicabl...
transformers/examples/legacy/seq2seq/train_mbart_cc25_enro.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/train_mbart_cc25_enro.sh", "repo_id": "transformers", "token_count": 500 }
409
# Example usage of the trace and attach_tracer decorators from transformers.utils.metrics import attach_tracer, traced @attach_tracer() class ExampleClass: def __init__(self, name): # The attach_tracer decorator has already created self.tracer for us self.name = name @traced # This method w...
transformers/examples/metrics-monitoring/metrics_example.py/0
{ "file_path": "transformers/examples/metrics-monitoring/metrics_example.py", "repo_id": "transformers", "token_count": 535 }
410
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from examples/modular-transformers/modular_multimodal2.py. # Do NOT edit this file manually as any edits will be overwritten by the generation...
transformers/examples/modular-transformers/modeling_multimodal2.py/0
{ "file_path": "transformers/examples/modular-transformers/modeling_multimodal2.py", "repo_id": "transformers", "token_count": 10149 }
411
# Example where we only want to overwrite the defaults of an init from transformers.models.gemma.configuration_gemma import GemmaConfig class NewModelConfig(GemmaConfig): def __init__( self, vocab_size=256030, hidden_size=64, intermediate_size=90, num_hidden_layers=28, ...
transformers/examples/modular-transformers/modular_new_model.py/0
{ "file_path": "transformers/examples/modular-transformers/modular_new_model.py", "repo_id": "transformers", "token_count": 468 }
412
<!--- 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/examples/pytorch/contrastive-image-text/README.md/0
{ "file_path": "transformers/examples/pytorch/contrastive-image-text/README.md", "repo_id": "transformers", "token_count": 1254 }
413
<!--- 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/examples/pytorch/language-modeling/README.md/0
{ "file_path": "transformers/examples/pytorch/language-modeling/README.md", "repo_id": "transformers", "token_count": 3374 }
414
#!/usr/bin/env python # Copyright 2024 The 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.org/licenses/LICENSE-2.0 # # U...
transformers/examples/pytorch/object-detection/run_object_detection.py/0
{ "file_path": "transformers/examples/pytorch/object-detection/run_object_detection.py", "repo_id": "transformers", "token_count": 8121 }
415
# Copyright 2022 The 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.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py", "repo_id": "transformers", "token_count": 11290 }
416
#!/usr/bin/env python # Copyright The HuggingFace Team and The 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.org/licens...
transformers/examples/pytorch/translation/run_translation.py/0
{ "file_path": "transformers/examples/pytorch/translation/run_translation.py", "repo_id": "transformers", "token_count": 12381 }
417
from abc import ABC, abstractmethod from collections.abc import Iterable from typing import Any, Optional import torch from .configuration_utils import PretrainedConfig from .utils import ( is_hqq_available, is_quanto_greater, is_torch_greater_or_equal, is_torchdynamo_compiling, logging, ) if is...
transformers/src/transformers/cache_utils.py/0
{ "file_path": "transformers/src/transformers/cache_utils.py", "repo_id": "transformers", "token_count": 27484 }
418