text
stringlengths
96
319k
id
stringlengths
14
178
metadata
dict
export default function StopIcon(props) { return ( <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strok...
transformers.js/examples/webgpu-vlm/src/components/icons/StopIcon.jsx/0
{ "file_path": "transformers.js/examples/webgpu-vlm/src/components/icons/StopIcon.jsx", "repo_id": "transformers.js", "token_count": 375 }
import { useRef, useCallback, useEffect } from "react"; export function AudioVisualizer({ stream, ...props }) { const canvasRef = useRef(null); const visualize = useCallback((stream) => { const audioContext = new (window.AudioContext || window.webkitAudioContext)(); const source = audioContext...
transformers.js/examples/webgpu-whisper/src/components/AudioVisualizer.jsx/0
{ "file_path": "transformers.js/examples/webgpu-whisper/src/components/AudioVisualizer.jsx", "repo_id": "transformers.js", "token_count": 865 }
import { useState, forwardRef, useRef, useImperativeHandle, useEffect, useCallback } from 'react'; const EXAMPLE_URL = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/whisper-timestamps-demo.mp4'; const MediaInput = forwardRef(({ onInputChange, onTimeUpdate, ...props }, ref) => { // UI s...
transformers.js/examples/whisper-word-timestamps/src/components/MediaInput.jsx/0
{ "file_path": "transformers.js/examples/whisper-word-timestamps/src/components/MediaInput.jsx", "repo_id": "transformers.js", "token_count": 3304 }
def generate_tokenizer_json(tokenizer): vocab = tokenizer.get_vocab() normalizers = [] if tokenizer.normalize: # Lowercase the input string normalizers.append({ "type": "Lowercase", }) if tokenizer.language == 'ron': # Replace diacritics normalize...
transformers.js/scripts/extra/vits.py/0
{ "file_path": "transformers.js/scripts/extra/vits.py", "repo_id": "transformers.js", "token_count": 1431 }
/** * @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": 3390 }
import { ImageProcessor, } from "../../base/image_processors_utils.js"; export class EfficientNetImageProcessor extends ImageProcessor { constructor(config) { super(config); // @ts-expect-error TS2339 this.include_top = this.config.include_top ?? true; if (this.include_top) { ...
transformers.js/src/models/efficientnet/image_processing_efficientnet.js/0
{ "file_path": "transformers.js/src/models/efficientnet/image_processing_efficientnet.js", "repo_id": "transformers.js", "token_count": 173 }
import { Processor } from "../../base/processing_utils.js"; import { AutoImageProcessor } from "../auto/image_processing_auto.js"; import { AutoTokenizer } from "../../tokenizers.js"; import { max, softmax } from "../../utils/maths.js"; const DECODE_TYPE_MAPPING = { 'char': ['char_decode', 1], 'bpe': ['bpe_dec...
transformers.js/src/models/mgp_str/processing_mgp_str.js/0
{ "file_path": "transformers.js/src/models/mgp_str/processing_mgp_str.js", "repo_id": "transformers.js", "token_count": 2810 }
import { ImageProcessor, } from "../../base/image_processors_utils.js"; import { stack, cat, } from "../../utils/tensor.js"; export class VitMatteImageProcessor extends ImageProcessor { /** * Calls the feature extraction process on an array of images, preprocesses * each image, and concaten...
transformers.js/src/models/vitmatte/image_processing_vitmatte.js/0
{ "file_path": "transformers.js/src/models/vitmatte/image_processing_vitmatte.js", "repo_id": "transformers.js", "token_count": 746 }
/* * Test that models loaded outside of the `pipeline` function work correctly (e.g., `AutoModel.from_pretrained(...)`); */ import { AutoTokenizer, AutoModel, BertModel, GPT2Model, T5ForConditionalGeneration, BertTokenizer, GPT2Tokenizer, T5Tokenizer } from "../src/transformers.js"; import { init, MAX_TEST_EXECUTION...
transformers.js/tests/models.test.js/0
{ "file_path": "transformers.js/tests/models.test.js", "repo_id": "transformers.js", "token_count": 1211 }
import { AutoProcessor, JinaCLIPProcessor } from "../../../src/transformers.js"; import { load_cached_image } from "../../asset_cache.js"; import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js"; export default () => { describe("JinaCLIPProcessor", () => { const model_id = "jinaai/jina-...
transformers.js/tests/models/jina_clip/test_processor_jina_clip.js/0
{ "file_path": "transformers.js/tests/models/jina_clip/test_processor_jina_clip.js", "repo_id": "transformers.js", "token_count": 863 }
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 }
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 }
import { pipeline, ObjectDetectionPipeline } 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 = "object-detection"; export default () => ...
transformers.js/tests/pipelines/test_pipelines_object_detection.js/0
{ "file_path": "transformers.js/tests/pipelines/test_pipelines_object_detection.js", "repo_id": "transformers.js", "token_count": 2625 }
import { PriorityQueue } from "../../src/utils/data-structures.js"; describe("Priority queue", () => { const EXAMPLE_ARRAY = [2, 5, 3, 1, 4]; it("default (max heap)", () => { const queue = new PriorityQueue(); queue.extend(EXAMPLE_ARRAY); expect(queue.pop()).toBe(5); }); it("min heap", () => { ...
transformers.js/tests/utils/data_structures.test.js/0
{ "file_path": "transformers.js/tests/utils/data_structures.test.js", "repo_id": "transformers.js", "token_count": 433 }
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples benchmark # make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!) export PYTHONPATH = src check_dirs := examples tests src utils exclude_folders := "" modif...
transformers/Makefile/0
{ "file_path": "transformers/Makefile", "repo_id": "transformers", "token_count": 1419 }
# 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": 1806 }
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 }
# كيفية تعديل أي نموذج من نماذج 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 }
# استخدام قنوات المعالجة لخادم ويب <Tip> يُعدّ إنشاء محرك استدلال أمرًا معقدًا، ويعتمد الحل "الأفضل" على مساحة مشكلتك. هل تستخدم وحدة المعالجة المركزية أم وحدة معالجة الرسومات؟ هل تريد أقل زمن وصول، أم أعلى معدل نقل، أم دعمًا للعديد من النماذج، أم مجرد تحقيق أقصى تحسين نموذج محدد؟ توجد طرق عديدة لمعالجة هذا الموضوع،...
transformers/docs/source/ar/pipeline_webserver.md/0
{ "file_path": "transformers/docs/source/ar/pipeline_webserver.md", "repo_id": "transformers", "token_count": 5178 }
# التصدير إلى 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 }
<!--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 }
<!--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/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/en/add_new_pipeline.md", "repo_id": "transformers", "token_count": 3561 }
<!--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/fsdp.md/0
{ "file_path": "transformers/docs/source/en/fsdp.md", "repo_id": "transformers", "token_count": 2238 }
<!--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/model.md/0
{ "file_path": "transformers/docs/source/en/main_classes/model.md", "repo_id": "transformers", "token_count": 745 }
<!--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/blenderbot.md/0
{ "file_path": "transformers/docs/source/en/model_doc/blenderbot.md", "repo_id": "transformers", "token_count": 1405 }
<!--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/dbrx.md/0
{ "file_path": "transformers/docs/source/en/model_doc/dbrx.md", "repo_id": "transformers", "token_count": 1794 }
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/distilbert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/distilbert.md", "repo_id": "transformers", "token_count": 7479 }
<!--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/falcon_mamba.md/0
{ "file_path": "transformers/docs/source/en/model_doc/falcon_mamba.md", "repo_id": "transformers", "token_count": 1451 }
<!--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/herbert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/herbert.md", "repo_id": "transformers", "token_count": 956 }
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/layoutlm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/layoutlm.md", "repo_id": "transformers", "token_count": 2088 }
<!--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/luke.md/0
{ "file_path": "transformers/docs/source/en/model_doc/luke.md", "repo_id": "transformers", "token_count": 2521 }
<!--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/mpt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mpt.md", "repo_id": "transformers", "token_count": 824 }
<!-- 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 in writing, software distributed under the License is...
transformers/docs/source/en/model_doc/olmoe.md/0
{ "file_path": "transformers/docs/source/en/model_doc/olmoe.md", "repo_id": "transformers", "token_count": 703 }
<!--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/phi3.md/0
{ "file_path": "transformers/docs/source/en/model_doc/phi3.md", "repo_id": "transformers", "token_count": 1218 }
<!--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/qwen2_vl.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qwen2_vl.md", "repo_id": "transformers", "token_count": 4923 }
<!--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/sam.md/0
{ "file_path": "transformers/docs/source/en/model_doc/sam.md", "repo_id": "transformers", "token_count": 2256 }
<!--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/superglue.md/0
{ "file_path": "transformers/docs/source/en/model_doc/superglue.md", "repo_id": "transformers", "token_count": 1984 }
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/trajectory_transformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/trajectory_transformer.md", "repo_id": "transformers", "token_count": 776 }
<!--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": 851 }
<!--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/zamba.md/0
{ "file_path": "transformers/docs/source/en/model_doc/zamba.md", "repo_id": "transformers", "token_count": 1045 }
<!--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/perf_train_cpu.md/0
{ "file_path": "transformers/docs/source/en/perf_train_cpu.md", "repo_id": "transformers", "token_count": 1331 }
<!--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/bitsandbytes.md/0
{ "file_path": "transformers/docs/source/en/quantization/bitsandbytes.md", "repo_id": "transformers", "token_count": 4147 }
<!--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/serialization.md/0
{ "file_path": "transformers/docs/source/en/serialization.md", "repo_id": "transformers", "token_count": 2975 }
<!--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": 2079 }
<!--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/bertology.md/0
{ "file_path": "transformers/docs/source/es/bertology.md", "repo_id": "transformers", "token_count": 761 }
<!--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/question_answering.md/0
{ "file_path": "transformers/docs/source/es/tasks/question_answering.md", "repo_id": "transformers", "token_count": 3912 }
<!--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/it/custom_models.md/0
{ "file_path": "transformers/docs/source/it/custom_models.md", "repo_id": "transformers", "token_count": 5886 }
<!--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/pipeline_tutorial.md/0
{ "file_path": "transformers/docs/source/it/pipeline_tutorial.md", "repo_id": "transformers", "token_count": 2398 }
<!--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/create_a_model.md/0
{ "file_path": "transformers/docs/source/ja/create_a_model.md", "repo_id": "transformers", "token_count": 8236 }
<!--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/pipelines.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/pipelines.md", "repo_id": "transformers", "token_count": 6685 }
<!--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/beit.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/beit.md", "repo_id": "transformers", "token_count": 3840 }
<!--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/bros.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/bros.md", "repo_id": "transformers", "token_count": 3458 }
<!--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_train_tpu_tf.md/0
{ "file_path": "transformers/docs/source/ja/perf_train_tpu_tf.md", "repo_id": "transformers", "token_count": 7360 }
<!--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/image_captioning.md/0
{ "file_path": "transformers/docs/source/ja/tasks/image_captioning.md", "repo_id": "transformers", "token_count": 3779 }
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/tasks/translation.md/0
{ "file_path": "transformers/docs/source/ja/tasks/translation.md", "repo_id": "transformers", "token_count": 7209 }
<!--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/accelerate.md/0
{ "file_path": "transformers/docs/source/ko/accelerate.md", "repo_id": "transformers", "token_count": 2885 }
<!--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/fsdp.md/0
{ "file_path": "transformers/docs/source/ko/fsdp.md", "repo_id": "transformers", "token_count": 5834 }
<!--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/ko/llm_optims.md/0
{ "file_path": "transformers/docs/source/ko/llm_optims.md", "repo_id": "transformers", "token_count": 15197 }
<!--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/trainer.md/0
{ "file_path": "transformers/docs/source/ko/main_classes/trainer.md", "repo_id": "transformers", "token_count": 1572 }
<!--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/convbert.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/convbert.md", "repo_id": "transformers", "token_count": 2979 }
<!--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/marian.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/marian.md", "repo_id": "transformers", "token_count": 5171 }
<!--- 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 ...
transformers/docs/source/ko/model_memory_anatomy.md/0
{ "file_path": "transformers/docs/source/ko/model_memory_anatomy.md", "repo_id": "transformers", "token_count": 8876 }
<!--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/perplexity.md/0
{ "file_path": "transformers/docs/source/ko/perplexity.md", "repo_id": "transformers", "token_count": 6268 }
<!--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/asr.md/0
{ "file_path": "transformers/docs/source/ko/tasks/asr.md", "repo_id": "transformers", "token_count": 9520 }
<!--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/trainer.md/0
{ "file_path": "transformers/docs/source/ko/trainer.md", "repo_id": "transformers", "token_count": 15986 }
<!--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/pipeline_tutorial.md/0
{ "file_path": "transformers/docs/source/pt/pipeline_tutorial.md", "repo_id": "transformers", "token_count": 2382 }
<!--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/zh/agents_advanced.md/0
{ "file_path": "transformers/docs/source/zh/agents_advanced.md", "repo_id": "transformers", "token_count": 4917 }
<!--- 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/zh/installation.md/0
{ "file_path": "transformers/docs/source/zh/installation.md", "repo_id": "transformers", "token_count": 4833 }
<!--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/zh/peft.md/0
{ "file_path": "transformers/docs/source/zh/peft.md", "repo_id": "transformers", "token_count": 3638 }
<!--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/tflite.md/0
{ "file_path": "transformers/docs/source/zh/tflite.md", "repo_id": "transformers", "token_count": 1386 }
#!/usr/bin/env python # coding=utf-8 # 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-...
transformers/examples/flax/language-modeling/run_clm_flax.py/0
{ "file_path": "transformers/examples/flax/language-modeling/run_clm_flax.py", "repo_id": "transformers", "token_count": 15979 }
# 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/rouge_cli.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/rouge_cli.py", "repo_id": "transformers", "token_count": 385 }
# coding=utf-8 # 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 obtain a cop...
transformers/examples/legacy/token-classification/utils_ner.py/0
{ "file_path": "transformers/examples/legacy/token-classification/utils_ner.py", "repo_id": "transformers", "token_count": 7661 }
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from examples/modular-transformers/modular_new_task_model.py. # Do NOT edit this file manually as any edits will be overwritten by the generat...
transformers/examples/modular-transformers/modeling_new_task_model.py/0
{ "file_path": "transformers/examples/modular-transformers/modeling_new_task_model.py", "repo_id": "transformers", "token_count": 9625 }
from typing import List, Optional, Tuple, Union import torch from transformers.modeling_outputs import CausalLMOutputWithPast from transformers.models.llama.modeling_llama import LlamaModel from ...cache_utils import Cache # example where we need some deps and some functions class SuperModel(LlamaModel): def f...
transformers/examples/modular-transformers/modular_super.py/0
{ "file_path": "transformers/examples/modular-transformers/modular_super.py", "repo_id": "transformers", "token_count": 566 }
#!/usr/bin/env python # coding=utf-8 # 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...
transformers/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py/0
{ "file_path": "transformers/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py", "repo_id": "transformers", "token_count": 10400 }
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 University of Cambridge, Tencent AI Lab, DeepMind and The University of Hong Kong Authors 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 th...
transformers/examples/pytorch/text-generation/run_generation_contrastive_search.py/0
{ "file_path": "transformers/examples/pytorch/text-generation/run_generation_contrastive_search.py", "repo_id": "transformers", "token_count": 1870 }
# coding=utf-8 # 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 obtain a cop...
transformers/examples/research_projects/adversarial/utils_hans.py/0
{ "file_path": "transformers/examples/research_projects/adversarial/utils_hans.py", "repo_id": "transformers", "token_count": 5431 }
import os from collections import deque import torch from torch.utils.data import Dataset # ------------ # Data loading # ------------ class CNNDMDataset(Dataset): """Abstracts the dataset used to train seq2seq models. The class will process the documents that are located in the specified folder. The ...
transformers/examples/research_projects/bertabs/utils_summarization.py/0
{ "file_path": "transformers/examples/research_projects/bertabs/utils_summarization.py", "repo_id": "transformers", "token_count": 2180 }
import multiprocessing import time from arguments import PretokenizationArguments from datasets import load_dataset from transformers import AutoTokenizer, HfArgumentParser def tokenize(example): output = {} output["input_ids"] = tokenizer(example["content"], truncation=False)["input_ids"] output["ratio...
transformers/examples/research_projects/codeparrot/scripts/pretokenizing.py/0
{ "file_path": "transformers/examples/research_projects/codeparrot/scripts/pretokenizing.py", "repo_id": "transformers", "token_count": 527 }
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
transformers/examples/research_projects/distillation/utils.py/0
{ "file_path": "transformers/examples/research_projects/distillation/utils.py", "repo_id": "transformers", "token_count": 1771 }
Author: [@vasudevgupta7](https://github.com/thevasudevgupta/) ## Intro In this project, we fine-tuned [**BigBird**](https://arxiv.org/abs/2007.14062) on [**natural-questions**](https://huggingface.co/datasets/natural_questions) dataset for **question-answering** task on long documents. **BigBird**, is a **sparse-att...
transformers/examples/research_projects/jax-projects/big_bird/README.md/0
{ "file_path": "transformers/examples/research_projects/jax-projects/big_bird/README.md", "repo_id": "transformers", "token_count": 824 }
#!/usr/bin/env python # coding=utf-8 # 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-...
transformers/examples/research_projects/jax-projects/model_parallel/run_clm_mp.py/0
{ "file_path": "transformers/examples/research_projects/jax-projects/model_parallel/run_clm_mp.py", "repo_id": "transformers", "token_count": 11750 }
# coding=utf-8 # Copyright 2018 The Google Flax Team Authors and 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 ...
transformers/examples/research_projects/performer/modeling_flax_performer.py/0
{ "file_path": "transformers/examples/research_projects/performer/modeling_flax_performer.py", "repo_id": "transformers", "token_count": 9147 }
to a snake Moses' assistant Egyptian royal court let his rod turn in to a snake The Pokémon Company Nintendo world's top-selling toy brand, the top-selling trading card game over 20 seasons to a snake Moses' assistant Egyptian royal court let his rod turn in to a snake The Pokémon Company Nintendo world's top-selling...
transformers/examples/research_projects/rag-end2end-retriever/test_run/dummy-train-data/train.target/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/test_run/dummy-train-data/train.target", "repo_id": "transformers", "token_count": 305 }
# Add parent directory to python path to access lightning_base.py export PYTHONPATH="../":"${PYTHONPATH}" # A sample finetuning run, you need to specify data_dir, output_dir and model_name_or_path # run ./examples/rag/finetune_rag.sh --help to see all the possible options python examples/rag/finetune_rag.py \ --d...
transformers/examples/research_projects/rag/finetune_rag.sh/0
{ "file_path": "transformers/examples/research_projects/rag/finetune_rag.sh", "repo_id": "transformers", "token_count": 440 }
# Copyright 2022 The Google Research 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 required by applicable law or agree...
transformers/examples/research_projects/self-training-text-classification/run.sh/0
{ "file_path": "transformers/examples/research_projects/self-training-text-classification/run.sh", "repo_id": "transformers", "token_count": 960 }
#!/usr/bin/env bash export PYTHONPATH="../":"${PYTHONPATH}" # From appendix C of paper https://arxiv.org/abs/1912.08777 # Set --gradient_accumulation_steps so that effective batch size is 256 (2*128, 4*64, 8*32, 16*16) python finetune.py \ --learning_rate=1e-4 \ --do_train \ --do_predict \ --n_val 100...
transformers/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh/0
{ "file_path": "transformers/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh", "repo_id": "transformers", "token_count": 208 }
<!--- Copyright 2022 The Microsoft 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 re...
transformers/examples/research_projects/tapex/README.md/0
{ "file_path": "transformers/examples/research_projects/tapex/README.md", "repo_id": "transformers", "token_count": 3713 }
# Simple VQGAN CLIP Author: @ErwannMillon This is a very simple VQGAN-CLIP implementation that was built as a part of the <a href= "https://github.com/ErwannMillon/face-editor"> Face Editor project </a> . This simplified version allows you to generate or edit images using text with just three lines of code. For a mo...
transformers/examples/research_projects/vqgan-clip/README.md/0
{ "file_path": "transformers/examples/research_projects/vqgan-clip/README.md", "repo_id": "transformers", "token_count": 777 }
#!/usr/bin/env bash python run_common_voice.py \ --model_name_or_path="facebook/wav2vec2-large-xlsr-53" \ --dataset_config_name="tr" \ --output_dir=./wav2vec2-large-xlsr-turkish-demo \ --overwrite_output_dir \ --num_train_epochs="5" \ --per_device_train_batch_size="16" \ --eval_strategy="ste...
transformers/examples/research_projects/wav2vec2/finetune_wav2vec2_xlsr_turkish.sh/0
{ "file_path": "transformers/examples/research_projects/wav2vec2/finetune_wav2vec2_xlsr_turkish.sh", "repo_id": "transformers", "token_count": 315 }
<!--- 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 ...
transformers/examples/tensorflow/contrastive-image-text/README.md/0
{ "file_path": "transformers/examples/tensorflow/contrastive-image-text/README.md", "repo_id": "transformers", "token_count": 1057 }
#!/usr/bin/env python # coding=utf-8 # 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/LI...
transformers/examples/tensorflow/token-classification/run_ner.py/0
{ "file_path": "transformers/examples/tensorflow/token-classification/run_ner.py", "repo_id": "transformers", "token_count": 11440 }
#!/usr/bin/env python # coding: utf-8 # 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/LICENS...
transformers/scripts/fsmt/fsmt-make-super-tiny-model.py/0
{ "file_path": "transformers/scripts/fsmt/fsmt-make-super-tiny-model.py", "repo_id": "transformers", "token_count": 1246 }
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/src/transformers/agents/agent_types.py/0
{ "file_path": "transformers/src/transformers/agents/agent_types.py", "repo_id": "transformers", "token_count": 3413 }
import copy import importlib.metadata import json import os from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple, Union import torch from packaging import version from .configuration_utils import PretrainedConfig from .utils import ( is_hqq_available, is_optimum_quanto_availab...
transformers/src/transformers/cache_utils.py/0
{ "file_path": "transformers/src/transformers/cache_utils.py", "repo_id": "transformers", "token_count": 44157 }
# 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/convert_pytorch_checkpoint_to_tf2.py/0
{ "file_path": "transformers/src/transformers/convert_pytorch_checkpoint_to_tf2.py", "repo_id": "transformers", "token_count": 6724 }
# coding=utf-8 # 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 obtain a cop...
transformers/src/transformers/data/processors/xnli.py/0
{ "file_path": "transformers/src/transformers/data/processors/xnli.py", "repo_id": "transformers", "token_count": 1505 }
import time import warnings from abc import ABC from collections import OrderedDict from copy import deepcopy from typing import Dict, List, Optional, Tuple, Union import numpy as np import torch from torch.nn import functional as F from ..pytorch_utils import isin_mps_friendly from ..tokenization_utils_base import P...
transformers/src/transformers/generation/stopping_criteria.py/0
{ "file_path": "transformers/src/transformers/generation/stopping_criteria.py", "repo_id": "transformers", "token_count": 10529 }
from ..utils import is_accelerate_available, is_torch_available, logging if is_accelerate_available(): from accelerate import init_empty_weights if is_torch_available(): import torch import torch.nn as nn import torch.nn.functional as F logger = logging.get_logger(__name__) # the weights are terna...
transformers/src/transformers/integrations/bitnet.py/0
{ "file_path": "transformers/src/transformers/integrations/bitnet.py", "repo_id": "transformers", "token_count": 4597 }