text
stringlengths
7
1.24M
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
519
import torch from dataclasses import dataclass from typing import Optional, Union, List from loguru import logger from text_generation_server.utils.import_utils import SYSTEM from text_generation_server.utils.weights import ( Weight, WeightsLoader, UnquantizedWeight, Weights, ) from text_generation_se...
text-generation-inference/server/text_generation_server/layers/fp8.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/layers/fp8.py", "repo_id": "text-generation-inference", "token_count": 3990 }
243
import torch from torch import nn from typing import Tuple, Optional from text_generation_server.utils.speculate import get_speculate from text_generation_server.layers.linear import FastLinear from text_generation_server.layers.tensor_parallel import ( TensorParallelHead, TensorParallelColumnLinear, ) class ...
text-generation-inference/server/text_generation_server/layers/medusa.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/layers/medusa.py", "repo_id": "text-generation-inference", "token_count": 2975 }
244
# coding=utf-8 # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compared # to G...
text-generation-inference/server/text_generation_server/models/custom_modeling/flash_gpt2_modeling.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_gpt2_modeling.py", "repo_id": "text-generation-inference", "token_count": 6789 }
245
# This code was adapted from https://github.com/lucidrains/flamingo-pytorch licensed under the MIT License. # # MIT License # # Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient # # Permission is hereby granted, free of charge, to any person obtaining a copy # of ...
text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_perceiver.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_perceiver.py", "repo_id": "text-generation-inference", "token_count": 5152 }
246
from io import BytesIO from PIL import Image import torch import time from dataclasses import dataclass from opentelemetry import trace from transformers import ( AutoProcessor, AutoTokenizer, PreTrainedTokenizerBase, ProcessorMixin, ) from typing import Optional, Tuple, List, Type, Dict from text_gen...
text-generation-inference/server/text_generation_server/models/idefics_causal_lm.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/idefics_causal_lm.py", "repo_id": "text-generation-inference", "token_count": 16844 }
247
import torch from loguru import logger import os import importlib.util def is_ipex_available(): return importlib.util.find_spec("intel_extension_for_pytorch") is not None def get_cuda_free_memory(device, memory_fraction): total_free_memory, _ = torch.cuda.mem_get_info(device) total_gpu_memory = torch....
text-generation-inference/server/text_generation_server/utils/import_utils.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/import_utils.py", "repo_id": "text-generation-inference", "token_count": 850 }
248
## How to release # Before the release Simple checklist on how to make releases for `tokenizers`. - Freeze `master` branch. - Run all tests (Check CI has properly run) - If any significant work, check benchmarks: - `cd tokenizers && cargo bench` (needs to be run on latest release tag to measure difference if it's ...
tokenizers/RELEASE.md/0
{ "file_path": "tokenizers/RELEASE.md", "repo_id": "tokenizers", "token_count": 1519 }
249
/* eslint-disable */ var globRequire = require console.log = (..._args: any[]) => {} describe('quicktourExample', () => { function require(mod: string) { if (mod.startsWith('tokenizers')) { return globRequire('../../') } else { return globRequire(mod) } } it.skip('trains the tokenizer',...
tokenizers/bindings/node/examples/documentation/quicktour.test.ts/0
{ "file_path": "tokenizers/bindings/node/examples/documentation/quicktour.test.ts", "repo_id": "tokenizers", "token_count": 2324 }
250
{ "name": "tokenizers-android-arm-eabi", "version": "0.13.4-rc1", "os": [ "android" ], "cpu": [ "arm" ], "main": "tokenizers.android-arm-eabi.node", "files": [ "tokenizers.android-arm-eabi.node" ], "description": "Tokenizers platform specific bindings", "keywords": [ "napi-rs", ...
tokenizers/bindings/node/npm/android-arm-eabi/package.json/0
{ "file_path": "tokenizers/bindings/node/npm/android-arm-eabi/package.json", "repo_id": "tokenizers", "token_count": 269 }
251
{ "name": "tokenizers-linux-x64-gnu", "version": "0.13.4-rc1", "os": [ "linux" ], "cpu": [ "x64" ], "main": "tokenizers.linux-x64-gnu.node", "files": [ "tokenizers.linux-x64-gnu.node" ], "description": "Tokenizers platform specific bindings", "keywords": [ "napi-rs", "NAPI", ...
tokenizers/bindings/node/npm/linux-x64-gnu/package.json/0
{ "file_path": "tokenizers/bindings/node/npm/linux-x64-gnu/package.json", "repo_id": "tokenizers", "token_count": 289 }
252
use crate::arc_rwlock_serde; use napi::bindgen_prelude::*; use napi_derive::napi; use serde::{Deserialize, Serialize}; use std::sync::{Arc, RwLock}; use tk::normalizers::NormalizerWrapper; use tk::NormalizedString; use tokenizers as tk; /// Normalizer #[derive(Debug, Clone, Serialize, Deserialize)] #[napi] pub struct ...
tokenizers/bindings/node/src/normalizers.rs/0
{ "file_path": "tokenizers/bindings/node/src/normalizers.rs", "repo_id": "tokenizers", "token_count": 1886 }
253
include Cargo.toml include pyproject.toml include rust-toolchain include ../../LICENSE recursive-include src * recursive-include tokenizers-lib * recursive-exclude tokenizers-lib/target *
tokenizers/bindings/python/MANIFEST.in/0
{ "file_path": "tokenizers/bindings/python/MANIFEST.in", "repo_id": "tokenizers", "token_count": 57 }
254
from typing import Dict, List, Optional, Tuple, Union from tokenizers import AddedToken, EncodeInput, Encoding, InputSequence, Tokenizer from tokenizers.decoders import Decoder from tokenizers.models import Model from tokenizers.normalizers import Normalizer from tokenizers.pre_tokenizers import PreTokenizer from toke...
tokenizers/bindings/python/py_src/tokenizers/implementations/base_tokenizer.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/base_tokenizer.py", "repo_id": "tokenizers", "token_count": 6036 }
255
import itertools import os import re from string import Template from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple from tokenizers import Encoding, Tokenizer dirname = os.path.dirname(__file__) css_filename = os.path.join(dirname, "visualizer-styles.css") with open(css_filename) as f: css...
tokenizers/bindings/python/py_src/tokenizers/tools/visualizer.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/tools/visualizer.py", "repo_id": "tokenizers", "token_count": 6754 }
256
use std::convert::TryInto; use std::sync::Arc; use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use crate::encoding::PyEncoding; use crate::error::ToPyResult; use serde::{Deserialize, Serialize}; use tk::processors::bert::BertProcessing; use tk::processors::byte_level::ByteLevel; use tk::processors::ro...
tokenizers/bindings/python/src/processors.rs/0
{ "file_path": "tokenizers/bindings/python/src/processors.rs", "repo_id": "tokenizers", "token_count": 8087 }
257
import pickle import pytest from tokenizers.models import BPE, Model, WordLevel, WordPiece from ..utils import bert_files, data_dir, roberta_files class TestBPE: def test_instantiate(self, roberta_files): assert isinstance(BPE(), Model) assert isinstance(BPE(), BPE) vocab = {"a": 0, "b"...
tokenizers/bindings/python/tests/bindings/test_models.py/0
{ "file_path": "tokenizers/bindings/python/tests/bindings/test_models.py", "repo_id": "tokenizers", "token_count": 2304 }
258
# Visualizer <tokenizerslangcontent> <python> ## Annotation [[autodoc]] tokenizers.tools.Annotation ## EncodingVisualizer [[autodoc]] tokenizers.tools.EncodingVisualizer - __call__ </python> <rust> The Rust API Reference is available directly on the [Docs.rs](https://docs.rs/tokenizers/latest/tokenizers/) webs...
tokenizers/docs/source-doc-builder/api/visualizer.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/api/visualizer.mdx", "repo_id": "tokenizers", "token_count": 134 }
259
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [0.13.2] - Python only changes ## [0.13.1] - [#1072] Fixing ...
tokenizers/tokenizers/CHANGELOG.md/0
{ "file_path": "tokenizers/tokenizers/CHANGELOG.md", "repo_id": "tokenizers", "token_count": 3388 }
260
<div align="center"> <h1><code>wasm-pack-template</code></h1> <strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong> <p> <a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/tr...
tokenizers/tokenizers/examples/unstable_wasm/README.md/0
{ "file_path": "tokenizers/tokenizers/examples/unstable_wasm/README.md", "repo_id": "tokenizers", "token_count": 811 }
261
stable
tokenizers/tokenizers/rust-toolchain/0
{ "file_path": "tokenizers/tokenizers/rust-toolchain", "repo_id": "tokenizers", "token_count": 2 }
262
use rand::distributions::WeightedIndex; use rand::prelude::*; use std::cell::RefCell; use std::cmp::{min, Ordering}; use std::collections::BinaryHeap; use std::rc::Rc; type NodeRef = Rc<RefCell<Node>>; type HypothesisRef = Rc<RefCell<Hypothesis>>; type Agenda = BinaryHeap<Hypothesis>; struct Hypothesis { node_ref...
tokenizers/tokenizers/src/models/unigram/lattice.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/unigram/lattice.rs", "repo_id": "tokenizers", "token_count": 12682 }
263
use crate::tokenizer::{NormalizedString, Normalizer, Result}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] pub struct Prepend { pub prepend: String, } impl Prepend { pub fn new(prepend: String) -> Self { Self { prepend } } } impl Norm...
tokenizers/tokenizers/src/normalizers/prepend.rs/0
{ "file_path": "tokenizers/tokenizers/src/normalizers/prepend.rs", "repo_id": "tokenizers", "token_count": 856 }
264
// Generated by modified Perl script at https://github.com/google/sentencepiece/blob/master/data/gen_unicode_scripts_code.pl // Unicode scripts : https://gist.github.com/Narsil/07556f26dc84a6baeff4d499e68d3cd2 // Rust adaptation : https://gist.github.com/Narsil/1df9fbbf5296a8d4d62de55dcb2fe700 #[derive(PartialEq, Debu...
tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/scripts.rs/0
{ "file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/scripts.rs", "repo_id": "tokenizers", "token_count": 46440 }
265
use crate::Result; use hf_hub::{api::sync::ApiBuilder, Repo, RepoType}; use std::collections::HashMap; use std::path::PathBuf; /// Defines the aditional parameters available for the `from_pretrained` function #[derive(Debug, Clone)] pub struct FromPretrainedParameters { pub revision: String, pub user_agent: Ha...
tokenizers/tokenizers/src/utils/from_pretrained.rs/0
{ "file_path": "tokenizers/tokenizers/src/utils/from_pretrained.rs", "repo_id": "tokenizers", "token_count": 913 }
266
# Troubleshooting This is a document explaining how to deal with various issues on Circle-CI. The entries may include actual solutions or pointers to Issues that cover those. ## Circle CI * pytest worker runs out of resident RAM and gets killed by `cgroups`: https://github.com/huggingface/transformers/issues/11408
transformers/.circleci/TROUBLESHOOT.md/0
{ "file_path": "transformers/.circleci/TROUBLESHOOT.md", "repo_id": "transformers", "token_count": 80 }
267
cff-version: "1.2.0" date-released: 2020-10 message: "If you use this software, please cite it using these metadata." title: "Transformers: State-of-the-Art Natural Language Processing" url: "https://github.com/huggingface/transformers" authors: - family-names: Wolf given-names: Thomas - family-names: Debut ...
transformers/CITATION.cff/0
{ "file_path": "transformers/CITATION.cff", "repo_id": "transformers", "token_count": 824 }
268
FROM python:3.10-slim ENV PYTHONDONTWRITEBYTECODE=1 USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git RUN apt-get install -y g++ cmake ENV UV_PYTHON=/usr/local/bin/python RUN pip --no-cache-dir install uv && uv venv RUN uv pip install --no-cache-dir -U pip setuptools albumentations s...
transformers/docker/examples-tf.dockerfile/0
{ "file_path": "transformers/docker/examples-tf.dockerfile", "repo_id": "transformers", "token_count": 222 }
269
FROM rocm/dev-ubuntu-22.04:5.6 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive ARG PYTORCH='2.1.1' ARG TORCH_VISION='0.16.1' ARG TORCH_AUDIO='2.1.1' ARG ROCM='5.6' RUN apt update && \ apt install -y --no-install-recommends \ libaio-dev \ git \ # These are required to build deepspeed...
transformers/docker/transformers-pytorch-deepspeed-amd-gpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-pytorch-deepspeed-amd-gpu/Dockerfile", "repo_id": "transformers", "token_count": 680 }
270
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/de/add_new_model.md/0
{ "file_path": "transformers/docs/source/de/add_new_model.md", "repo_id": "transformers", "token_count": 23975 }
271
<!--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/transformers_agents.md/0
{ "file_path": "transformers/docs/source/de/transformers_agents.md", "repo_id": "transformers", "token_count": 6629 }
272
<!--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/conversations.md/0
{ "file_path": "transformers/docs/source/en/conversations.md", "repo_id": "transformers", "token_count": 4633 }
273
<!--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/internal/image_processing_utils.md/0
{ "file_path": "transformers/docs/source/en/internal/image_processing_utils.md", "repo_id": "transformers", "token_count": 437 }
274
<!--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/main_classes/feature_extractor.md/0
{ "file_path": "transformers/docs/source/en/main_classes/feature_extractor.md", "repo_id": "transformers", "token_count": 383 }
275
<!--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/altclip.md/0
{ "file_path": "transformers/docs/source/en/model_doc/altclip.md", "repo_id": "transformers", "token_count": 1400 }
276
<!--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/bit.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bit.md", "repo_id": "transformers", "token_count": 1005 }
277
<!--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/clipseg.md/0
{ "file_path": "transformers/docs/source/en/model_doc/clipseg.md", "repo_id": "transformers", "token_count": 1221 }
278
<!--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/deberta-v2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/deberta-v2.md", "repo_id": "transformers", "token_count": 1846 }
279
<!--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/dpr.md/0
{ "file_path": "transformers/docs/source/en/model_doc/dpr.md", "repo_id": "transformers", "token_count": 1170 }
280
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/flava.md/0
{ "file_path": "transformers/docs/source/en/model_doc/flava.md", "repo_id": "transformers", "token_count": 916 }
281
<!--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/gptj.md/0
{ "file_path": "transformers/docs/source/en/model_doc/gptj.md", "repo_id": "transformers", "token_count": 2807 }
282
<!--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/llava_next_video.md/0
{ "file_path": "transformers/docs/source/en/model_doc/llava_next_video.md", "repo_id": "transformers", "token_count": 3893 }
283
<!--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/mt5.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mt5.md", "repo_id": "transformers", "token_count": 1400 }
284
<!--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/prophetnet.md/0
{ "file_path": "transformers/docs/source/en/model_doc/prophetnet.md", "repo_id": "transformers", "token_count": 1169 }
285
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/roberta-prelayernorm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roberta-prelayernorm.md", "repo_id": "transformers", "token_count": 1519 }
286
<!--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/speech_to_text_2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/speech_to_text_2.md", "repo_id": "transformers", "token_count": 1610 }
287
<!--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/tapex.md/0
{ "file_path": "transformers/docs/source/en/model_doc/tapex.md", "repo_id": "transformers", "token_count": 2167 }
288
<!--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/video_llava.md/0
{ "file_path": "transformers/docs/source/en/model_doc/video_llava.md", "repo_id": "transformers", "token_count": 2643 }
289
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/wav2vec2-conformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/wav2vec2-conformer.md", "repo_id": "transformers", "token_count": 1104 }
290
<!--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": 2101 }
291
<!--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_gpu_many.md/0
{ "file_path": "transformers/docs/source/en/perf_train_gpu_many.md", "repo_id": "transformers", "token_count": 10578 }
292
<!--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/fbgemm_fp8.md/0
{ "file_path": "transformers/docs/source/en/quantization/fbgemm_fp8.md", "repo_id": "transformers", "token_count": 807 }
293
<!--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": 2704 }
294
<!--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/glossary.md/0
{ "file_path": "transformers/docs/source/es/glossary.md", "repo_id": "transformers", "token_count": 10085 }
295
- sections: - local: index title: 🤗 Transformers - local: quicktour title: Visite rapide - local: installation title: Installation title: Démarrer - sections: - local: tutoriel_pipeline title: Pipelines pour l'inférence - local: autoclass_tutorial title: Chargement d...
transformers/docs/source/fr/_toctree.yml/0
{ "file_path": "transformers/docs/source/fr/_toctree.yml", "repo_id": "transformers", "token_count": 381 }
296
<!--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/big_models.md/0
{ "file_path": "transformers/docs/source/it/big_models.md", "repo_id": "transformers", "token_count": 2214 }
297
<!--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/perf_train_cpu.md/0
{ "file_path": "transformers/docs/source/it/perf_train_cpu.md", "repo_id": "transformers", "token_count": 1310 }
298
<!-- Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
transformers/docs/source/ja/benchmarks.md/0
{ "file_path": "transformers/docs/source/ja/benchmarks.md", "repo_id": "transformers", "token_count": 8873 }
299
<!--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/internal/generation_utils.md/0
{ "file_path": "transformers/docs/source/ja/internal/generation_utils.md", "repo_id": "transformers", "token_count": 3478 }
300
<!--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/main_classes/logging.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/logging.md", "repo_id": "transformers", "token_count": 2182 }
301
<!--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/autoformer.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/autoformer.md", "repo_id": "transformers", "token_count": 1746 }
302
<!--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/blip-2.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/blip-2.md", "repo_id": "transformers", "token_count": 2258 }
303
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/model_doc/conditional_detr.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/conditional_detr.md", "repo_id": "transformers", "token_count": 1847 }
304
<!--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/detr.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/detr.md", "repo_id": "transformers", "token_count": 7983 }
305
<!--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_cpu_many.md/0
{ "file_path": "transformers/docs/source/ja/perf_train_cpu_many.md", "repo_id": "transformers", "token_count": 3281 }
306
<!--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/task_summary.md/0
{ "file_path": "transformers/docs/source/ja/task_summary.md", "repo_id": "transformers", "token_count": 11246 }
307
<!--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/semantic_segmentation.md/0
{ "file_path": "transformers/docs/source/ja/tasks/semantic_segmentation.md", "repo_id": "transformers", "token_count": 10521 }
308
<!--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/create_a_model.md/0
{ "file_path": "transformers/docs/source/ko/create_a_model.md", "repo_id": "transformers", "token_count": 11706 }
309
<!--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 }
310
<!--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": 9521 }
311
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ko/tasks/question_answering.md/0
{ "file_path": "transformers/docs/source/ko/tasks/question_answering.md", "repo_id": "transformers", "token_count": 9397 }
312
<!--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 }
313
<!--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 }
314
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/big_models.md/0
{ "file_path": "transformers/docs/source/zh/big_models.md", "repo_id": "transformers", "token_count": 3100 }
315
<!--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/main_classes/optimizer_schedules.md/0
{ "file_path": "transformers/docs/source/zh/main_classes/optimizer_schedules.md", "repo_id": "transformers", "token_count": 833 }
316
<!--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/preprocessing.md/0
{ "file_path": "transformers/docs/source/zh/preprocessing.md", "repo_id": "transformers", "token_count": 12751 }
317
from transformers.models.llama.configuration_llama import LlamaConfig # Example where we only want to only add a new config argument and new arg doc # here there is no `ARG` so we are gonna take parent doc class MyNewModelConfig(LlamaConfig): r""" mlp_bias (`bool`, *optional*, defaults to `False`) """ ...
transformers/examples/diff-conversion/diff_my_new_model.py/0
{ "file_path": "transformers/examples/diff-conversion/diff_my_new_model.py", "repo_id": "transformers", "token_count": 191 }
318
#!/usr/bin/env python3 import json from typing import Iterator, List, Union from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers from tokenizers.implementations.base_tokenizer import BaseTokenizer from tokenizers.models import Unigram from tokenizers.processors import Te...
transformers/examples/flax/language-modeling/t5_tokenizer_model.py/0
{ "file_path": "transformers/examples/flax/language-modeling/t5_tokenizer_model.py", "repo_id": "transformers", "token_count": 1823 }
319
import argparse import glob import logging import os from argparse import Namespace from importlib import import_module import numpy as np import torch from lightning_base import BaseTransformer, add_generic_args, generic_train from seqeval.metrics import accuracy_score, f1_score, precision_score, recall_score from to...
transformers/examples/legacy/pytorch-lightning/run_ner.py/0
{ "file_path": "transformers/examples/legacy/pytorch-lightning/run_ner.py", "repo_id": "transformers", "token_count": 4295 }
320
# 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/finetune.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/finetune.sh", "repo_id": "transformers", "token_count": 297 }
321
#!/usr/bin/env python # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
transformers/examples/legacy/seq2seq/run_eval_search.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/run_eval_search.py", "repo_id": "transformers", "token_count": 2316 }
322
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/examples/legacy/seq2seq/train_distil_marian_enro.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/train_distil_marian_enro.sh", "repo_id": "transformers", "token_count": 553 }
323
<!--- 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 ...
transformers/examples/pytorch/audio-classification/README.md/0
{ "file_path": "transformers/examples/pytorch/audio-classification/README.md", "repo_id": "transformers", "token_count": 2210 }
324
<!--- 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 ...
transformers/examples/pytorch/instance-segmentation/README.md/0
{ "file_path": "transformers/examples/pytorch/instance-segmentation/README.md", "repo_id": "transformers", "token_count": 3501 }
325
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
transformers/examples/pytorch/multiple-choice/run_swag.py/0
{ "file_path": "transformers/examples/pytorch/multiple-choice/run_swag.py", "repo_id": "transformers", "token_count": 8237 }
326
#!/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/LICENSE-...
transformers/examples/pytorch/token-classification/run_ner.py/0
{ "file_path": "transformers/examples/pytorch/token-classification/run_ner.py", "repo_id": "transformers", "token_count": 11450 }
327
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and Microsoft Corporation. # 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....
transformers/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_bert.py/0
{ "file_path": "transformers/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_bert.py", "repo_id": "transformers", "token_count": 6758 }
328
# CodeParrot 🦜 <p align="center"> <img src="https://huggingface.co/datasets/lvwerra/repo-images/raw/main/code-highlighting-streamlit.png" alt="drawing" width="350"/> </p> ## What is this about? This is an open-source effort to train and evaluate code generation models. CodeParrot 🦜 is a GPT-2 model trained from ...
transformers/examples/research_projects/codeparrot/README.md/0
{ "file_path": "transformers/examples/research_projects/codeparrot/README.md", "repo_id": "transformers", "token_count": 5034 }
329
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="fsner", version="0.0.1", author="msi sayef", author_email="msi.sayef@gmail.com", description="Few-shot Named Entity Recognition", long_description=long_description, ...
transformers/examples/research_projects/fsner/setup.py/0
{ "file_path": "transformers/examples/research_projects/fsner/setup.py", "repo_id": "transformers", "token_count": 341 }
330
# coding=utf-8 # Copyright 2020-present, AllenAI Authors, University of Illinois Urbana-Champaign, # Intel Nervana Systems 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 ...
transformers/examples/research_projects/movement-pruning/emmental/modules/binarizer.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/emmental/modules/binarizer.py", "repo_id": "transformers", "token_count": 2364 }
331
# Plug and Play Language Models: a Simple Approach to Controlled Text Generation Authors: [Sumanth Dathathri](https://dathath.github.io/), [Andrea Madotto](https://andreamad8.github.io/), Janice Lan, Jane Hung, Eric Frank, [Piero Molino](https://w4nderlu.st/), [Jason Yosinski](http://yosinski.com/), and [Rosanne Liu](...
transformers/examples/research_projects/pplm/README.md/0
{ "file_path": "transformers/examples/research_projects/pplm/README.md", "repo_id": "transformers", "token_count": 747 }
332
import logging from pathlib import Path import numpy as np import pytorch_lightning as pl import torch from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint from pytorch_lightning.utilities import rank_zero_only from utils_rag import save_json def count_trainable_parameters(model): model_paramet...
transformers/examples/research_projects/rag-end2end-retriever/callbacks_rag.py/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/callbacks_rag.py", "repo_id": "transformers", "token_count": 1977 }
333
export PYTHONPATH="../":"${PYTHONPATH}" python use_own_knowledge_dataset.py ray start --head python finetune_rag.py \ --model_name_or_path facebook/rag-token-base \ --model_type rag_token \ --context_encoder_name facebook/dpr-ctx_encoder-multiset-base \ --fp16 \ --gpus 1 \ --profile \ --e...
transformers/examples/research_projects/rag-end2end-retriever/test_run/test_rag_new_features.sh/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/test_run/test_rag_new_features.sh", "repo_id": "transformers", "token_count": 153 }
334
import tempfile import unittest from make_student import create_student_by_copying_alternating_layers from transformers import AutoConfig from transformers.file_utils import cached_property from transformers.testing_utils import require_torch TINY_BART = "sshleifer/bart-tiny-random" TINY_T5 = "patrickvonplaten/t5-t...
transformers/examples/research_projects/seq2seq-distillation/_test_make_student.py/0
{ "file_path": "transformers/examples/research_projects/seq2seq-distillation/_test_make_student.py", "repo_id": "transformers", "token_count": 660 }
335
### Saved Pseudo-Labels These are the generations of various large models on various large **training** sets. All in all they took about 200 GPU hours to produce. ### Available Pseudo-labels | Dataset | Model | Link ...
transformers/examples/research_projects/seq2seq-distillation/precomputed_pseudo_labels.md/0
{ "file_path": "transformers/examples/research_projects/seq2seq-distillation/precomputed_pseudo_labels.md", "repo_id": "transformers", "token_count": 1861 }
336
# VisualBERT Demo This demo shows usage of VisualBERT VQA model and is adapted from LXMERT demo present [here](https://github.com/huggingface/transformers/blob/main/examples/research_projects/lxmert/demo.ipynb). 1. make a virtualenv: ``virtualenv venv`` and activate ``source venv/bin/activate`` 2. install reqs: ``pip ...
transformers/examples/research_projects/visual_bert/README.md/0
{ "file_path": "transformers/examples/research_projects/visual_bert/README.md", "repo_id": "transformers", "token_count": 127 }
337
# Parts of the code are adapted from the snippets provided in the TorchAudio Wav2Vec forced alignment tutorial. # The full tutorial can be found here: https://pytorch.org/audio/stable/tutorials/forced_alignment_tutorial.html import argparse import os from dataclasses import dataclass import torch import torchaudio fr...
transformers/examples/research_projects/wav2vec2/alignment.py/0
{ "file_path": "transformers/examples/research_projects/wav2vec2/alignment.py", "repo_id": "transformers", "token_count": 4170 }
338
<!--- Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/examples/research_projects/xtreme-s/README.md/0
{ "file_path": "transformers/examples/research_projects/xtreme-s/README.md", "repo_id": "transformers", "token_count": 3399 }
339
#!/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/LICENSE-...
transformers/examples/tensorflow/question-answering/run_qa.py/0
{ "file_path": "transformers/examples/tensorflow/question-answering/run_qa.py", "repo_id": "transformers", "token_count": 15732 }
340
# 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/hubconf.py/0
{ "file_path": "transformers/hubconf.py", "repo_id": "transformers", "token_count": 3244 }
341
#!/usr/bin/env python # coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
transformers/src/transformers/agents/llm_engine.py/0
{ "file_path": "transformers/src/transformers/agents/llm_engine.py", "repo_id": "transformers", "token_count": 1900 }
342