text
stringlengths
5
631k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
647
import { env, pipeline } from '@xenova/transformers'; // Skip local model check since we are downloading the model from the Hugging Face Hub. env.allowLocalModels = false; class MyZeroShotClassificationPipeline { static task = 'zero-shot-classification'; static model = 'MoritzLaurer/deberta-v3-xsmall-zeroshot...
transformers.js/examples/zero-shot-classification/src/worker.js/0
{ "file_path": "transformers.js/examples/zero-shot-classification/src/worker.js", "repo_id": "transformers.js", "token_count": 584 }
357
from optimum.exporters.onnx.model_configs import WhisperOnnxConfig from optimum.exporters.onnx.base import ConfigBehavior from typing import Dict import logging logger = logging.getLogger(__name__) # List of [layer, head] pairs that select the cross-attention heads that are highly correlated to word-level timing. # ...
transformers.js/scripts/extra/whisper.py/0
{ "file_path": "transformers.js/scripts/extra/whisper.py", "repo_id": "transformers.js", "token_count": 1726 }
358
/** * @module generation/streamers */ import { mergeArrays } from '../utils/core.js'; import { is_chinese_char } from '../tokenizers.js'; import { apis } from '../env.js'; export class BaseStreamer { /** * Function that is called by `.generate()` to push new tokens * @param {bigint[][]} value *...
transformers.js/src/generation/streamers.js/0
{ "file_path": "transformers.js/src/generation/streamers.js", "repo_id": "transformers.js", "token_count": 3502 }
359
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class DonutImageProcessor extends ImageProcessor { pad_image(pixelData, imgDims, padSize, options = {}) { const [imageHeight, imageWidth, imageChannels] = imgDims; let image_mean = this.image_mean; if (!Arr...
transformers.js/src/models/donut/image_processing_donut.js/0
{ "file_path": "transformers.js/src/models/donut/image_processing_donut.js", "repo_id": "transformers.js", "token_count": 482 }
360
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class JinaCLIPImageProcessor extends ImageProcessor { constructor(config) { // JinaCLIPImageProcessor uses a custom preprocessor_config.json, so we configure it here const { resize_mode, fill_color, interpolation, si...
transformers.js/src/models/jina_clip/image_processing_jina_clip.js/0
{ "file_path": "transformers.js/src/models/jina_clip/image_processing_jina_clip.js", "repo_id": "transformers.js", "token_count": 382 }
361
import { ImageProcessor, post_process_object_detection, } from "../../base/image_processors_utils.js"; export class OwlViTImageProcessor extends ImageProcessor { /** @type {typeof post_process_object_detection} */ post_process_object_detection(...args) { return post_process_object_detection(.....
transformers.js/src/models/owlvit/image_processing_owlvit.js/0
{ "file_path": "transformers.js/src/models/owlvit/image_processing_owlvit.js", "repo_id": "transformers.js", "token_count": 141 }
362
import { ImageProcessor, post_process_semantic_segmentation, } from "../../base/image_processors_utils.js"; export class SegformerImageProcessor extends ImageProcessor { /** @type {typeof post_process_semantic_segmentation} */ post_process_semantic_segmentation(...args) { return post_process_...
transformers.js/src/models/segformer/image_processing_segformer.js/0
{ "file_path": "transformers.js/src/models/segformer/image_processing_segformer.js", "repo_id": "transformers.js", "token_count": 145 }
363
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 WeSpeakerFeatureExtractor extends FeatureExtractor { constructor(con...
transformers.js/src/models/wespeaker/feature_extraction_wespeaker.js/0
{ "file_path": "transformers.js/src/models/wespeaker/feature_extraction_wespeaker.js", "repo_id": "transformers.js", "token_count": 1641 }
364
/** * A base class for creating callable objects. * See [here](https://stackoverflow.com/q/76073890) for more information. * * @type {new () => {(...args: any[]): any, _call(...args: any[]): any}} */ export const Callable = /** @type {any} */ (class { /** * Creates a new instance of the Callable class. ...
transformers.js/src/utils/generic.js/0
{ "file_path": "transformers.js/src/utils/generic.js", "repo_id": "transformers.js", "token_count": 439 }
365
import { GPT2Tokenizer } from "../../../src/tokenizers.js"; import { BASE_TEST_STRINGS, SENTENCEPIECE_TEST_STRINGS } from "../test_strings.js"; export const TOKENIZER_CLASS = GPT2Tokenizer; export const TEST_CONFIG = { // - clean_up_tokenization_spaces=true // - default pretokenization regex "Xenova/gpt2": { ...
transformers.js/tests/models/gpt2/test_tokenization_gpt2.js/0
{ "file_path": "transformers.js/tests/models/gpt2/test_tokenization_gpt2.js", "repo_id": "transformers.js", "token_count": 12398 }
366
import { LlamaTokenizer, LlamaForCausalLM } from "../../../src/transformers.js"; import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, MAX_TEST_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js"; export default () => { describe("LlamaForCausalLM", () => { const model_id = "hf-internal-t...
transformers.js/tests/models/llama/test_modeling_llama.js/0
{ "file_path": "transformers.js/tests/models/llama/test_modeling_llama.js", "repo_id": "transformers.js", "token_count": 1273 }
367
import { AutoImageProcessor, NougatImageProcessor } 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 () => { // NougatImageProcessor // - tests padding after normalizatio...
transformers.js/tests/models/nougat/test_image_processing_nougat.js/0
{ "file_path": "transformers.js/tests/models/nougat/test_image_processing_nougat.js", "repo_id": "transformers.js", "token_count": 471 }
368
import { WhisperTokenizer, WhisperForConditionalGeneration, full } 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("WhisperForConditionalGeneration", () => { const mo...
transformers.js/tests/models/whisper/test_modeling_whisper.js/0
{ "file_path": "transformers.js/tests/models/whisper/test_modeling_whisper.js", "repo_id": "transformers.js", "token_count": 2460 }
369
import { pipeline, ImageToTextPipeline } 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_image } from "../asset_cache.js"; const PIPELINE_ID = "image-to-text"; export default () => { des...
transformers.js/tests/pipelines/test_pipelines_image_to_text.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_image_to_text.js", "repo_id": "transformers.js", "token_count": 684 }
370
<!--- 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/README.md/0
{ "file_path": "transformers/README.md", "repo_id": "transformers", "token_count": 5920 }
371
# 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": 1864 }
372
FROM python:3.10 LABEL maintainer="Hugging Face" RUN apt update RUN git clone https://github.com/huggingface/transformers RUN python3 -m pip install --no-cache-dir --upgrade pip && python3 -m pip install --no-cache-dir git+https://github.com/huggingface/doc-builder ./transformers[dev] RUN apt-get -y update && apt-get...
transformers/docker/transformers-doc-builder/Dockerfile/0
{ "file_path": "transformers/docker/transformers-doc-builder/Dockerfile", "repo_id": "transformers", "token_count": 292 }
373
# Translating the Transformers documentation into your language As part of our mission to democratize machine learning, we aim to make the Transformers library available in many more languages! Follow the steps below to help translate the documentation into your language. ## Open an Issue 1. Navigate to the Issues p...
transformers/docs/TRANSLATING.md/0
{ "file_path": "transformers/docs/TRANSLATING.md", "repo_id": "transformers", "token_count": 745 }
374
# كيفية تعديل أي نموذج من نماذج Transformers توفر مكتبة [🤗 Transformers](https://github.com/huggingface/transformers) مجموعة من النماذج المسبقة التدريب والأدوات لمعالجة اللغات الطبيعية، والرؤية، وما إلى ذلك. على الرغم من أن هذه النماذج تغطي مجموعة واسعة من التطبيقات، فقد تواجه حالات استخدام لا تدعمها المكتبة بشكل افت...
transformers/docs/source/ar/how_to_hack_models.md/0
{ "file_path": "transformers/docs/source/ar/how_to_hack_models.md", "repo_id": "transformers", "token_count": 5880 }
375
# استخدام قنوات المعالجة لخادم ويب <Tip> يُعدّ إنشاء محرك استدلال أمرًا معقدًا، ويعتمد الحل "الأفضل" على مساحة مشكلتك. هل تستخدم وحدة المعالجة المركزية أم وحدة معالجة الرسومات؟ هل تريد أقل زمن وصول، أم أعلى معدل نقل، أم دعمًا للعديد من النماذج، أم مجرد تحقيق أقصى تحسين نموذج محدد؟ توجد طرق عديدة لمعالجة هذا الموضوع،...
transformers/docs/source/ar/pipeline_webserver.md/0
{ "file_path": "transformers/docs/source/ar/pipeline_webserver.md", "repo_id": "transformers", "token_count": 5178 }
376
# التصدير إلى TFLite [TensorFlow Lite](https://www.tensorflow.org/lite/guide) هو إطار عمل خفيف الوزن لنشر نماذج التعلم الآلي على الأجهزة المحدودة الموارد، مثل الهواتف المحمولة، والأنظمة المدمجة، وأجهزة إنترنت الأشياء (IoT). تم تصميم TFLite لتشغيل النماذج وتحسينها بكفاءة على هذه الأجهزة ذات الطاقة الحاسوبية والذاكرة وا...
transformers/docs/source/ar/tflite.md/0
{ "file_path": "transformers/docs/source/ar/tflite.md", "repo_id": "transformers", "token_count": 1409 }
377
<!--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/de/llm_tutorial.md/0
{ "file_path": "transformers/docs/source/de/llm_tutorial.md", "repo_id": "transformers", "token_count": 4767 }
378
<!--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/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/en/add_new_pipeline.md", "repo_id": "transformers", "token_count": 3645 }
379
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/deepspeed.md/0
{ "file_path": "transformers/docs/source/en/deepspeed.md", "repo_id": "transformers", "token_count": 15781 }
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/en/internal/generation_utils.md/0
{ "file_path": "transformers/docs/source/en/internal/generation_utils.md", "repo_id": "transformers", "token_count": 2665 }
381
<!--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/main_classes/text_generation.md/0
{ "file_path": "transformers/docs/source/en/main_classes/text_generation.md", "repo_id": "transformers", "token_count": 446 }
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 agreed...
transformers/docs/source/en/model_doc/bart.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bart.md", "repo_id": "transformers", "token_count": 1516 }
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/en/model_doc/blip.md/0
{ "file_path": "transformers/docs/source/en/model_doc/blip.md", "repo_id": "transformers", "token_count": 1487 }
384
<!--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/cohere.md/0
{ "file_path": "transformers/docs/source/en/model_doc/cohere.md", "repo_id": "transformers", "token_count": 2074 }
385
<!--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/efficientformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/efficientformer.md", "repo_id": "transformers", "token_count": 1095 }
386
<!--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/falcon3.md/0
{ "file_path": "transformers/docs/source/en/model_doc/falcon3.md", "repo_id": "transformers", "token_count": 680 }
387
<!--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/gemma3.md/0
{ "file_path": "transformers/docs/source/en/model_doc/gemma3.md", "repo_id": "transformers", "token_count": 3524 }
388
<!--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/gpt_oss.md/0
{ "file_path": "transformers/docs/source/en/model_doc/gpt_oss.md", "repo_id": "transformers", "token_count": 729 }
389
<!--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/hubert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/hubert.md", "repo_id": "transformers", "token_count": 1706 }
390
<!--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/jukebox.md/0
{ "file_path": "transformers/docs/source/en/model_doc/jukebox.md", "repo_id": "transformers", "token_count": 1404 }
391
<!--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/llama4.md/0
{ "file_path": "transformers/docs/source/en/model_doc/llama4.md", "repo_id": "transformers", "token_count": 4744 }
392
<!--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/mluke.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mluke.md", "repo_id": "transformers", "token_count": 921 }
393
<!--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/model_doc/musicgen.md/0
{ "file_path": "transformers/docs/source/en/model_doc/musicgen.md", "repo_id": "transformers", "token_count": 3863 }
394
<!--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/model_doc/open-llama.md/0
{ "file_path": "transformers/docs/source/en/model_doc/open-llama.md", "repo_id": "transformers", "token_count": 716 }
395
<!--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 to...
transformers/docs/source/en/model_doc/phi4_multimodal.md/0
{ "file_path": "transformers/docs/source/en/model_doc/phi4_multimodal.md", "repo_id": "transformers", "token_count": 2039 }
396
<!--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/roformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roformer.md", "repo_id": "transformers", "token_count": 1342 }
397
<!--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/model_doc/siglip.md/0
{ "file_path": "transformers/docs/source/en/model_doc/siglip.md", "repo_id": "transformers", "token_count": 2345 }
398
<!--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/swin2sr.md/0
{ "file_path": "transformers/docs/source/en/model_doc/swin2sr.md", "repo_id": "transformers", "token_count": 1108 }
399
<!--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/trocr.md/0
{ "file_path": "transformers/docs/source/en/model_doc/trocr.md", "repo_id": "transformers", "token_count": 1834 }
400
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/vision-text-dual-encoder.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vision-text-dual-encoder.md", "repo_id": "transformers", "token_count": 745 }
401
<!--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/wav2vec2_phoneme.md/0
{ "file_path": "transformers/docs/source/en/model_doc/wav2vec2_phoneme.md", "repo_id": "transformers", "token_count": 946 }
402
<!--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/yolos.md/0
{ "file_path": "transformers/docs/source/en/model_doc/yolos.md", "repo_id": "transformers", "token_count": 1676 }
403
<!--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_infer_gpu_multi.md/0
{ "file_path": "transformers/docs/source/en/perf_infer_gpu_multi.md", "repo_id": "transformers", "token_count": 5408 }
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 applicable law or agreed...
transformers/docs/source/en/quantization/aqlm.md/0
{ "file_path": "transformers/docs/source/en/quantization/aqlm.md", "repo_id": "transformers", "token_count": 1194 }
405
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/image_captioning.md/0
{ "file_path": "transformers/docs/source/en/tasks/image_captioning.md", "repo_id": "transformers", "token_count": 2698 }
406
<!--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/torchscript.md/0
{ "file_path": "transformers/docs/source/en/torchscript.md", "repo_id": "transformers", "token_count": 2035 }
407
<!--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/create_a_model.md/0
{ "file_path": "transformers/docs/source/es/create_a_model.md", "repo_id": "transformers", "token_count": 6229 }
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 applicable law or ...
transformers/docs/source/es/pr_checks.md/0
{ "file_path": "transformers/docs/source/es/pr_checks.md", "repo_id": "transformers", "token_count": 2659 }
409
<!--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/hi/accelerate.md/0
{ "file_path": "transformers/docs/source/hi/accelerate.md", "repo_id": "transformers", "token_count": 3992 }
410
<!--- 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 }
411
<!--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": 6489 }
412
<!--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": 9114 }
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 agreed...
transformers/docs/source/ja/main_classes/trainer.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/trainer.md", "repo_id": "transformers", "token_count": 19579 }
414
<!--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/big_bird.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/big_bird.md", "repo_id": "transformers", "token_count": 2774 }
415
<!--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/model_doc/clap.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/clap.md", "repo_id": "transformers", "token_count": 1774 }
416
<!--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.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/deberta.md", "repo_id": "transformers", "token_count": 3610 }
417
<!--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_cpu.md/0
{ "file_path": "transformers/docs/source/ja/perf_infer_cpu.md", "repo_id": "transformers", "token_count": 1977 }
418
<!--⚠️ 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 }
419
<!--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/tasks/masked_language_modeling.md/0
{ "file_path": "transformers/docs/source/ja/tasks/masked_language_modeling.md", "repo_id": "transformers", "token_count": 7720 }
420
<!--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 }
421
<!--- 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/ko/contributing.md/0
{ "file_path": "transformers/docs/source/ko/contributing.md", "repo_id": "transformers", "token_count": 15627 }
422
<!--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/ko/internal/audio_utils.md/0
{ "file_path": "transformers/docs/source/ko/internal/audio_utils.md", "repo_id": "transformers", "token_count": 739 }
423
<!--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/ko/model_doc/autoformer.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/autoformer.md", "repo_id": "transformers", "token_count": 2604 }
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/ko/model_doc/deberta-v2.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/deberta-v2.md", "repo_id": "transformers", "token_count": 4059 }
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/ko/model_doc/swinv2.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/swinv2.md", "repo_id": "transformers", "token_count": 2649 }
426
<!--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/perf_infer_gpu_multi.md/0
{ "file_path": "transformers/docs/source/ko/perf_infer_gpu_multi.md", "repo_id": "transformers", "token_count": 11472 }
427
<!--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/gptq.md/0
{ "file_path": "transformers/docs/source/ko/quantization/gptq.md", "repo_id": "transformers", "token_count": 4640 }
428
<!--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/ko/tasks/knowledge_distillation_for_image_classification.md/0
{ "file_path": "transformers/docs/source/ko/tasks/knowledge_distillation_for_image_classification.md", "repo_id": "transformers", "token_count": 5193 }
429
<!--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/ko/tasks/zero_shot_image_classification.md/0
{ "file_path": "transformers/docs/source/ko/tasks/zero_shot_image_classification.md", "repo_id": "transformers", "token_count": 3889 }
430
<!--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/pt/create_a_model.md/0
{ "file_path": "transformers/docs/source/pt/create_a_model.md", "repo_id": "transformers", "token_count": 6000 }
431
- sections: - local: index title: 🤗 Transformers title: Get started
transformers/docs/source/tr/_toctree.yml/0
{ "file_path": "transformers/docs/source/tr/_toctree.yml", "repo_id": "transformers", "token_count": 25 }
432
<!-- 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/zh/fsdp.md/0
{ "file_path": "transformers/docs/source/zh/fsdp.md", "repo_id": "transformers", "token_count": 4054 }
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/zh/serialization.md/0
{ "file_path": "transformers/docs/source/zh/serialization.md", "repo_id": "transformers", "token_count": 4929 }
434
#!/usr/bin/env python # 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 ...
transformers/examples/flax/image-captioning/run_image_captioning_flax.py/0
{ "file_path": "transformers/examples/flax/image-captioning/run_image_captioning_flax.py", "repo_id": "transformers", "token_count": 24294 }
435
# Summarization (Seq2Seq model) training examples The following example showcases how to finetune a sequence-to-sequence model for summarization using the JAX/Flax backend. JAX/Flax allows you to trace pure functions and compile them into efficient, fused accelerator code on both GPU and TPU. Models written in JAX/Fl...
transformers/examples/flax/summarization/README.md/0
{ "file_path": "transformers/examples/flax/summarization/README.md", "repo_id": "transformers", "token_count": 544 }
436
#!/usr/bin/env python # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, 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 obtai...
transformers/examples/legacy/run_language_modeling.py/0
{ "file_path": "transformers/examples/legacy/run_language_modeling.py", "repo_id": "transformers", "token_count": 5659 }
437
# 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/old_test_seq2seq_examples_multi_gpu.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/old_test_seq2seq_examples_multi_gpu.py", "repo_id": "transformers", "token_count": 771 }
438
if ! [ -f ./dev.txt ]; then echo "Downloading CONLL2003 dev dataset...." curl -L -o ./dev.txt 'https://github.com/davidsbatista/NER-datasets/raw/master/CONLL2003/valid.txt' fi if ! [ -f ./test.txt ]; then echo "Downloading CONLL2003 test dataset...." curl -L -o ./test.txt 'https://github.com/davidsbatista/NER-...
transformers/examples/legacy/token-classification/run_chunk.sh/0
{ "file_path": "transformers/examples/legacy/token-classification/run_chunk.sh", "repo_id": "transformers", "token_count": 414 }
439
from transformers.models.deformable_detr.modeling_deformable_detr import DeformableDetrModel # Here, the old and new model have by essence a common "detr" suffix. Make sure everything is correctly named # in this case (i.e., we do not wrongly detect `Detr` as part of a suffix to remove) class TestDetrModel(Deformable...
transformers/examples/modular-transformers/modular_test_detr.py/0
{ "file_path": "transformers/examples/modular-transformers/modular_test_detr.py", "repo_id": "transformers", "token_count": 103 }
440
# 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/image-classification/run_image_classification_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/image-classification/run_image_classification_no_trainer.py", "repo_id": "transformers", "token_count": 11614 }
441
#!/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/pytorch/language-modeling/run_mlm.py/0
{ "file_path": "transformers/examples/pytorch/language-modeling/run_mlm.py", "repo_id": "transformers", "token_count": 12678 }
442
#!/usr/bin/env python # Copyright 2021 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/speech-recognition/run_speech_recognition_ctc.py/0
{ "file_path": "transformers/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py", "repo_id": "transformers", "token_count": 13691 }
443
#!/usr/bin/env python # Copyright 2020 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/tensorflow/text-classification/run_glue.py/0
{ "file_path": "transformers/examples/tensorflow/text-classification/run_glue.py", "repo_id": "transformers", "token_count": 11087 }
444
# Copyright 2023 The HuggingFace Inc. team and the librosa & torchaudio authors. # # 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/src/transformers/audio_utils.py/0
{ "file_path": "transformers/src/transformers/audio_utils.py", "repo_id": "transformers", "token_count": 19810 }
445
# Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
transformers/src/transformers/convert_slow_tokenizer.py/0
{ "file_path": "transformers/src/transformers/convert_slow_tokenizer.py", "repo_id": "transformers", "token_count": 30858 }
446
# 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/src/transformers/debug_utils.py/0
{ "file_path": "transformers/src/transformers/debug_utils.py", "repo_id": "transformers", "token_count": 5149 }
447
# coding=utf-8 # Copyright 2021 The Google AI Flax Team Authors, and The HuggingFace Inc. team. # Copyright (c) 2020, 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 o...
transformers/src/transformers/generation/flax_utils.py/0
{ "file_path": "transformers/src/transformers/generation/flax_utils.py", "repo_id": "transformers", "token_count": 22064 }
448
# 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 applicabl...
transformers/src/transformers/integrations/accelerate.py/0
{ "file_path": "transformers/src/transformers/integrations/accelerate.py", "repo_id": "transformers", "token_count": 2636 }
449
# coding=utf-8 # Copyright 2024 The ggml.ai team and The HuggingFace Inc. team. and pygguf author (github.com/99991) # https://github.com/99991/pygguf # # 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 Lic...
transformers/src/transformers/integrations/ggml.py/0
{ "file_path": "transformers/src/transformers/integrations/ggml.py", "repo_id": "transformers", "token_count": 13284 }
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 applicabl...
transformers/src/transformers/integrations/vptq.py/0
{ "file_path": "transformers/src/transformers/integrations/vptq.py", "repo_id": "transformers", "token_count": 1926 }
451
#include <torch/extension.h> #include <ATen/ATen.h> #include <vector> #define min(a, b) ((a)<(b)?(a):(b)) #define max(a, b) ((a)>(b)?(a):(b)) std::vector<at::Tensor> index_max_kernel( at::Tensor index_vals, at::Tensor indices, int A_num_block, int B_num_block ); at::Tensor mm_to_sparse_kernel( at::Tensor d...
transformers/src/transformers/kernels/mra/cuda_launch.h/0
{ "file_path": "transformers/src/transformers/kernels/mra/cuda_launch.h", "repo_id": "transformers", "token_count": 312 }
452
# 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/src/transformers/loss/loss_for_object_detection.py/0
{ "file_path": "transformers/src/transformers/loss/loss_for_object_detection.py", "repo_id": "transformers", "token_count": 9848 }
453
# 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/src/transformers/modeling_tf_outputs.py/0
{ "file_path": "transformers/src/transformers/modeling_tf_outputs.py", "repo_id": "transformers", "token_count": 20569 }
454
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/aria/modular_aria.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # ...
transformers/src/transformers/models/aria/configuration_aria.py/0
{ "file_path": "transformers/src/transformers/models/aria/configuration_aria.py", "repo_id": "transformers", "token_count": 6787 }
455
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/auto/modeling_auto.py/0
{ "file_path": "transformers/src/transformers/models/auto/modeling_auto.py", "repo_id": "transformers", "token_count": 42881 }
456