text
stringlengths
7
324k
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
463
# 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_neox_modeling.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_neox_modeling.py", "repo_id": "text-generation-inference", "token_count": 6185 }
233
# imlementation of the PhiModel and PhiForCausalLM classes import torch import torch.distributed import math from torch import nn from typing import Optional, List, Tuple, Any from transformers.configuration_utils import PretrainedConfig from transformers.modeling_outputs import CausalLMOutputWithPast from text_gene...
text-generation-inference/server/text_generation_server/models/custom_modeling/phi_modeling.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/phi_modeling.py", "repo_id": "text-generation-inference", "token_count": 5626 }
234
import torch import torch.distributed from typing import List, Optional, Tuple from transformers import ( AutoTokenizer, AutoConfig, AutoProcessor, ) from text_generation_server.models.custom_modeling.idefics_config import IdeficsConfig from text_generation_server.models.custom_modeling.idefics_processin...
text-generation-inference/server/text_generation_server/models/idefics.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/idefics.py", "repo_id": "text-generation-inference", "token_count": 1344 }
235
import torch from typing import List AWQ_PACK_ORDER = [0, 2, 4, 6, 1, 3, 5, 7] REVERSE_AWQ_PACK_ORDER = [0, 4, 1, 5, 2, 6, 3, 7] def pack(imatrix: torch.Tensor, direction: str = "column"): """ Packs a 4-bit integer matrix into a packed 32-bit integer matrix. Args: imatrix (torch.Tensor): matrix ...
text-generation-inference/server/text_generation_server/utils/awq/conversion_utils.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/awq/conversion_utils.py", "repo_id": "text-generation-inference", "token_count": 1384 }
236
import os import json from loguru import logger import torch from transformers import AutoTokenizer from peft import AutoPeftModelForCausalLM, AutoPeftModelForSeq2SeqLM def download_and_unload_peft(model_id, revision, trust_remote_code): torch_dtype = torch.float16 logger.info("Trying to load a Peft model. ...
text-generation-inference/server/text_generation_server/utils/peft.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/peft.py", "repo_id": "text-generation-inference", "token_count": 629 }
237
nodeLinker: node-modules npmAuditRegistry: 'https://registry.npmjs.org' yarnPath: .yarn/releases/yarn-3.5.1.cjs
tokenizers/bindings/node/.yarnrc.yml/0
{ "file_path": "tokenizers/bindings/node/.yarnrc.yml", "repo_id": "tokenizers", "token_count": 53 }
238
/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { BPE, Unigram, WordPiece } from '../../' const MOCKS_DIR = __dirname + '/__mocks__' describe('WordPiece', () => { describe('fromFile', () => { it('throws if called with only one argument', ...
tokenizers/bindings/node/lib/bindings/models.test.ts/0
{ "file_path": "tokenizers/bindings/node/lib/bindings/models.test.ts", "repo_id": "tokenizers", "token_count": 818 }
239
# `tokenizers-linux-arm-gnueabihf` This is the **armv7-unknown-linux-gnueabihf** binary for `tokenizers`
tokenizers/bindings/node/npm/linux-arm-gnueabihf/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/linux-arm-gnueabihf/README.md", "repo_id": "tokenizers", "token_count": 42 }
240
{ "name": "tokenizers", "version": "0.14.0-dev0", "repository": { "type": "git", "url": "git+https://github.com/huggingface/tokenizers.git" }, "bugs": { "url": "https://github.com/huggingface/tokenizers/issues" }, "homepage": "https://github.com/huggingface/tokenizers/tree/master/bindings/node...
tokenizers/bindings/node/package.json/0
{ "file_path": "tokenizers/bindings/node/package.json", "repo_id": "tokenizers", "token_count": 1532 }
241
{ "compilerOptions": { "target": "ES2018", "strict": true, "moduleResolution": "node", "module": "CommonJS", "noUnusedLocals": true, "noUnusedParameters": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true }, "include": ["."], "exclude": ["node_modules"] }
tokenizers/bindings/node/tsconfig.json/0
{ "file_path": "tokenizers/bindings/node/tsconfig.json", "repo_id": "tokenizers", "token_count": 129 }
242
<jupyter_start><jupyter_code>!wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt -O /tmp/bert-base-uncased-vocab.txt from tokenizers import BertWordPieceTokenizer from tokenizers.tools import EncodingVisualizer EncodingVisualizer.unk_token_regex.search("aaa[udsnk]aaa") text = """Mathi...
tokenizers/bindings/python/examples/using_the_visualizer.ipynb/0
{ "file_path": "tokenizers/bindings/python/examples/using_the_visualizer.ipynb", "repo_id": "tokenizers", "token_count": 1221 }
243
# Generated content DO NOT EDIT from .. import pre_tokenizers PreTokenizer = pre_tokenizers.PreTokenizer BertPreTokenizer = pre_tokenizers.BertPreTokenizer ByteLevel = pre_tokenizers.ByteLevel CharDelimiterSplit = pre_tokenizers.CharDelimiterSplit Digits = pre_tokenizers.Digits Metaspace = pre_tokenizers.Metaspace Pun...
tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.py", "repo_id": "tokenizers", "token_count": 177 }
244
use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use tk::tokenizer::{Offsets, PaddingDirection}; use tk::utils::truncation::TruncationDirection; use tokenizers as tk; use crate::error::{deprecation_warning, PyError}; /// The :class:`~tokenizers.Encoding` represents the output of a :class:`~tokenizers.T...
tokenizers/bindings/python/src/encoding.rs/0
{ "file_path": "tokenizers/bindings/python/src/encoding.rs", "repo_id": "tokenizers", "token_count": 7397 }
245
from tokenizers import Tokenizer, decoders, models, normalizers, pre_tokenizers, processors from tokenizers.implementations import BaseTokenizer class TestBaseTokenizer: def test_get_set_components(self): toki = Tokenizer(models.BPE()) toki.normalizer = normalizers.NFC() toki.pre_tokenizer...
tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py/0
{ "file_path": "tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py", "repo_id": "tokenizers", "token_count": 550 }
246
# Normalizers <tokenizerslangcontent> <python> ## BertNormalizer [[autodoc]] tokenizers.normalizers.BertNormalizer ## Lowercase [[autodoc]] tokenizers.normalizers.Lowercase ## NFC [[autodoc]] tokenizers.normalizers.NFC ## NFD [[autodoc]] tokenizers.normalizers.NFD ## NFKC [[autodoc]] tokenizers.normalizers.NF...
tokenizers/docs/source-doc-builder/api/normalizers.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/api/normalizers.mdx", "repo_id": "tokenizers", "token_count": 350 }
247
🤗 Tokenizers is tested on Python 3.5+. You should install 🤗 Tokenizers in a `virtual environment <https://docs.python.org/3/library/venv.html>`_. If you're unfamiliar with Python virtual environments, check out the `user guide <https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`__. C...
tokenizers/docs/source/installation/python.inc/0
{ "file_path": "tokenizers/docs/source/installation/python.inc", "repo_id": "tokenizers", "token_count": 384 }
248
use tokenizers::models::wordpiece::WordPiece; use tokenizers::{AddedToken, Tokenizer}; fn main() { let start = std::time::Instant::now(); let mut tokenizer = Tokenizer::new(WordPiece::default()); // Mix special and not special // You can make sure ids are in order, and special status is correct. l...
tokenizers/tokenizers/examples/serialization.rs/0
{ "file_path": "tokenizers/tokenizers/examples/serialization.rs", "repo_id": "tokenizers", "token_count": 300 }
249
#![allow(clippy::map_entry)] use super::{Pair, WithFirstLastIterator, Word, BPE}; use crate::parallelism::*; use crate::tokenizer::{AddedToken, Result, Trainer}; use crate::utils::progress::{ProgressBar, ProgressStyle}; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::collections::{BinaryHeap, Has...
tokenizers/tokenizers/src/models/bpe/trainer.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/bpe/trainer.rs", "repo_id": "tokenizers", "token_count": 15117 }
250
pub mod bert; pub mod precompiled; pub mod prepend; pub mod replace; pub mod strip; pub mod unicode; pub mod utils; pub use crate::normalizers::bert::BertNormalizer; pub use crate::normalizers::precompiled::Precompiled; pub use crate::normalizers::prepend::Prepend; pub use crate::normalizers::replace::Replace; pub use...
tokenizers/tokenizers/src/normalizers/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/normalizers/mod.rs", "repo_id": "tokenizers", "token_count": 1090 }
251
mod pre_tokenizer; mod scripts; // Re-export the PreTokenizer pub use pre_tokenizer::UnicodeScripts;
tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/mod.rs", "repo_id": "tokenizers", "token_count": 35 }
252
use std::borrow::Borrow; use std::collections::HashMap; use std::hash::Hash; use std::sync::RwLock; /// The default capacity for a `BPE`'s internal cache. pub static DEFAULT_CACHE_CAPACITY: usize = 10_000; /// Provides a simple multithread cache to speed up BPE tokenization that will try to read values /// concurrent...
tokenizers/tokenizers/src/utils/cache.rs/0
{ "file_path": "tokenizers/tokenizers/src/utils/cache.rs", "repo_id": "tokenizers", "token_count": 1436 }
253
use tokenizers::models::bpe::BPE; use tokenizers::pre_tokenizers::whitespace::Whitespace; use tokenizers::{DecoderWrapper, NormalizerWrapper, PostProcessorWrapper, PreTokenizerWrapper}; use tokenizers::{Model, Tokenizer, TokenizerBuilder}; #[test] fn bpe_values_after_training() { let mut tokenizer = TokenizerBuild...
tokenizers/tokenizers/tests/training.rs/0
{ "file_path": "tokenizers/tokenizers/tests/training.rs", "repo_id": "tokenizers", "token_count": 851 }
254
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands) SHELL ["sh", "-lc"] # The following `ARG` are mainly used to specify the versions explicit...
transformers/docker/transformers-all-latest-gpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-all-latest-gpu/Dockerfile", "repo_id": "transformers", "token_count": 1166 }
255
### Translating the Transformers documentation into your language As part of our mission to democratize machine learning, we'd love to make the Transformers library available in many more languages! Follow the steps below if you want to help translate the documentation into your language 🙏. **🗞️ Open an issue** To...
transformers/docs/TRANSLATING.md/0
{ "file_path": "transformers/docs/TRANSLATING.md", "repo_id": "transformers", "token_count": 948 }
256
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/docs/source/de/pr_checks.md/0
{ "file_path": "transformers/docs/source/de/pr_checks.md", "repo_id": "transformers", "token_count": 4986 }
257
<!--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/benchmarks.md/0
{ "file_path": "transformers/docs/source/en/benchmarks.md", "repo_id": "transformers", "token_count": 7208 }
258
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/hpo_train.md/0
{ "file_path": "transformers/docs/source/en/hpo_train.md", "repo_id": "transformers", "token_count": 2076 }
259
<!--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/callback.md/0
{ "file_path": "transformers/docs/source/en/main_classes/callback.md", "repo_id": "transformers", "token_count": 1520 }
260
<!--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/tokenizer.md/0
{ "file_path": "transformers/docs/source/en/main_classes/tokenizer.md", "repo_id": "transformers", "token_count": 1144 }
261
<!--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/bertweet.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bertweet.md", "repo_id": "transformers", "token_count": 806 }
262
<!--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 }
263
<!--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/lilt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/lilt.md", "repo_id": "transformers", "token_count": 1291 }
264
<!--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/mbart.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mbart.md", "repo_id": "transformers", "token_count": 3130 }
265
<!--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 }
266
<!--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/owlvit.md/0
{ "file_path": "transformers/docs/source/en/model_doc/owlvit.md", "repo_id": "transformers", "token_count": 1986 }
267
<!--Copyright 2021 NVIDIA Corporation and The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by a...
transformers/docs/source/en/model_doc/qdqbert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qdqbert.md", "repo_id": "transformers", "token_count": 1982 }
268
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/swin2sr.md/0
{ "file_path": "transformers/docs/source/en/model_doc/swin2sr.md", "repo_id": "transformers", "token_count": 979 }
269
<!--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/vit_msn.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vit_msn.md", "repo_id": "transformers", "token_count": 1191 }
270
<!--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/xlm-v.md/0
{ "file_path": "transformers/docs/source/en/model_doc/xlm-v.md", "repo_id": "transformers", "token_count": 809 }
271
<!--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_infer_cpu.md/0
{ "file_path": "transformers/docs/source/en/perf_infer_cpu.md", "repo_id": "transformers", "token_count": 2080 }
272
<!--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/quantization.md/0
{ "file_path": "transformers/docs/source/en/quantization.md", "repo_id": "transformers", "token_count": 11471 }
273
<!--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/tasks/mask_generation.md/0
{ "file_path": "transformers/docs/source/en/tasks/mask_generation.md", "repo_id": "transformers", "token_count": 2851 }
274
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/zero_shot_object_detection.md/0
{ "file_path": "transformers/docs/source/en/tasks/zero_shot_object_detection.md", "repo_id": "transformers", "token_count": 3901 }
275
<!--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 }
276
<!--Copyright 2020 de The HuggingFace Team. Todos los derechos reservados Con licencia bajo la Licencia Apache, Versión 2.0 (la "Licencia"); No puedes usar este archivo excepto de conformidad con la Licencia. Puedes obtener una copia de la Licencia en http://www.apache.org/licenses/LICENSE-2.0 Al menos que sea requr...
transformers/docs/source/es/philosophy.md/0
{ "file_path": "transformers/docs/source/es/philosophy.md", "repo_id": "transformers", "token_count": 1964 }
277
<!--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/add_new_model.md/0
{ "file_path": "transformers/docs/source/it/add_new_model.md", "repo_id": "transformers", "token_count": 17333 }
278
<!--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_infer_gpu_many.md/0
{ "file_path": "transformers/docs/source/it/perf_infer_gpu_many.md", "repo_id": "transformers", "token_count": 420 }
279
<!-- 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/add_new_model.md/0
{ "file_path": "transformers/docs/source/ja/add_new_model.md", "repo_id": "transformers", "token_count": 28026 }
280
<!--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/deepspeed.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/deepspeed.md", "repo_id": "transformers", "token_count": 49427 }
281
<!--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/align.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/align.md", "repo_id": "transformers", "token_count": 2911 }
282
<!--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/biogpt.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/biogpt.md", "repo_id": "transformers", "token_count": 1982 }
283
<!--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/clipseg.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/clipseg.md", "repo_id": "transformers", "token_count": 2201 }
284
<!--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/deformable_detr.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/deformable_detr.md", "repo_id": "transformers", "token_count": 1792 }
285
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/perf_infer_gpu_one.md/0
{ "file_path": "transformers/docs/source/ja/perf_infer_gpu_one.md", "repo_id": "transformers", "token_count": 9331 }
286
<!-- Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
transformers/docs/source/ja/preprocessing.md/0
{ "file_path": "transformers/docs/source/ja/preprocessing.md", "repo_id": "transformers", "token_count": 12720 }
287
<!--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/tf_xla.md/0
{ "file_path": "transformers/docs/source/ja/tf_xla.md", "repo_id": "transformers", "token_count": 4413 }
288
<!--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/big_models.md/0
{ "file_path": "transformers/docs/source/ko/big_models.md", "repo_id": "transformers", "token_count": 4438 }
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/ko/model_doc/whisper.md/0
{ "file_path": "transformers/docs/source/ko/model_doc/whisper.md", "repo_id": "transformers", "token_count": 2696 }
290
<!--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 }
291
<!--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/testing.md/0
{ "file_path": "transformers/docs/source/ko/testing.md", "repo_id": "transformers", "token_count": 35298 }
292
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/pt/fast_tokenizers.md/0
{ "file_path": "transformers/docs/source/pt/fast_tokenizers.md", "repo_id": "transformers", "token_count": 937 }
293
- sections: - local: index title: 🤗 Transformers 简介 - local: quicktour title: 快速上手 - local: installation title: 安装 title: 开始使用 - sections: - local: pipeline_tutorial title: 使用pipelines进行推理 - local: autoclass_tutorial title: 使用AutoClass编写可移植的代码 - local: preprocessing title: 预处理数据 ...
transformers/docs/source/zh/_toctree.yml/0
{ "file_path": "transformers/docs/source/zh/_toctree.yml", "repo_id": "transformers", "token_count": 2046 }
294
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/perf_torch_compile.md/0
{ "file_path": "transformers/docs/source/zh/perf_torch_compile.md", "repo_id": "transformers", "token_count": 6786 }
295
<!--- 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 a...
transformers/examples/flax/README.md/0
{ "file_path": "transformers/examples/flax/README.md", "repo_id": "transformers", "token_count": 1866 }
296
# 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-2.0 # # Unless require...
transformers/examples/flax/question-answering/utils_qa.py/0
{ "file_path": "transformers/examples/flax/question-answering/utils_qa.py", "repo_id": "transformers", "token_count": 9468 }
297
#!/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/vision/run_image_classification.py/0
{ "file_path": "transformers/examples/flax/vision/run_image_classification.py", "repo_id": "transformers", "token_count": 9849 }
298
# 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/question-answering/run_squad.py/0
{ "file_path": "transformers/examples/legacy/question-answering/run_squad.py", "repo_id": "transformers", "token_count": 14759 }
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 applicabl...
transformers/examples/legacy/seq2seq/old_test_calculate_rouge.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/old_test_calculate_rouge.py", "repo_id": "transformers", "token_count": 1793 }
300
# 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/seq2seq_trainer.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/seq2seq_trainer.py", "repo_id": "transformers", "token_count": 4874 }
301
# 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/utils.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/utils.py", "repo_id": "transformers", "token_count": 10920 }
302
<!--- Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/examples/pytorch/contrastive-image-text/README.md/0
{ "file_path": "transformers/examples/pytorch/contrastive-image-text/README.md", "repo_id": "transformers", "token_count": 1268 }
303
#!/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/LI...
transformers/examples/pytorch/language-modeling/run_fim.py/0
{ "file_path": "transformers/examples/pytorch/language-modeling/run_fim.py", "repo_id": "transformers", "token_count": 15754 }
304
#!/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/pytorch/question-answering/run_qa_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/question-answering/run_qa_no_trainer.py", "repo_id": "transformers", "token_count": 18922 }
305
#!/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": 10176 }
306
#!/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 }
307
# 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 }
308
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 }
309
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 }
310
# Distil* Author: @VictorSanh This folder contains the original code used to train Distil* as well as examples showcasing how to use DistilBERT, DistilRoBERTa and DistilGPT2. **January 20, 2020 - Bug fixing** We have recently discovered and fixed [a bug](https://github.com/huggingface/transformers/commit/48cbf267c98...
transformers/examples/research_projects/distillation/README.md/0
{ "file_path": "transformers/examples/research_projects/distillation/README.md", "repo_id": "transformers", "token_count": 5075 }
311
# 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": 1772 }
312
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 }
313
#!/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": 11794 }
314
""" coding=utf-8 Copyright 2018, Antonio Mendoza Hao Tan, Mohit Bansal Adapted From Facebook Inc, Detectron2 && Huggingface Co. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www...
transformers/examples/research_projects/lxmert/modeling_frcnn.py/0
{ "file_path": "transformers/examples/research_projects/lxmert/modeling_frcnn.py", "repo_id": "transformers", "token_count": 34766 }
315
from .configuration_bert_masked import MaskedBertConfig from .modeling_bert_masked import ( MaskedBertForMultipleChoice, MaskedBertForQuestionAnswering, MaskedBertForSequenceClassification, MaskedBertForTokenClassification, MaskedBertModel, ) from .modules import *
transformers/examples/research_projects/movement-pruning/emmental/__init__.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/emmental/__init__.py", "repo_id": "transformers", "token_count": 99 }
316
# 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 }
317
#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # Copyright 2021 NVIDIA Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
transformers/examples/research_projects/quantization-qdqbert/run_quant_qa.py/0
{ "file_path": "transformers/examples/research_projects/quantization-qdqbert/run_quant_qa.py", "repo_id": "transformers", "token_count": 12720 }
318
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 }
319
# 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 }
320
# 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": 961 }
321
#!/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 }
322
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 The Microsoft 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.apac...
transformers/examples/research_projects/tapex/run_wikitablequestions_with_tapex.py/0
{ "file_path": "transformers/examples/research_projects/tapex/run_wikitablequestions_with_tapex.py", "repo_id": "transformers", "token_count": 10470 }
323
# Fine-Tuning week of XLSR-Wav2Vec2 on 60 languages 🌍 Welcome to the fine-tuning week! The goal of this week is to have state-of-the-art automatic speech recognition (ASR) models in as many languages as possible. The fine-tuning week ends on Friday, the 26th March at midnight PST time. Participants are encouraged to...
transformers/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md/0
{ "file_path": "transformers/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md", "repo_id": "transformers", "token_count": 9587 }
324
# 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/research_projects/wav2vec2/test_wav2vec2_deepspeed.py/0
{ "file_path": "transformers/examples/research_projects/wav2vec2/test_wav2vec2_deepspeed.py", "repo_id": "transformers", "token_count": 2788 }
325
#!/usr/bin/env python # coding=utf-8 # 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-...
transformers/examples/tensorflow/contrastive-image-text/run_clip.py/0
{ "file_path": "transformers/examples/tensorflow/contrastive-image-text/run_clip.py", "repo_id": "transformers", "token_count": 11224 }
326
<!--- 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/tensorflow/question-answering/README.md/0
{ "file_path": "transformers/examples/tensorflow/question-answering/README.md", "repo_id": "transformers", "token_count": 657 }
327
#!/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-tiny-model.py/0
{ "file_path": "transformers/scripts/fsmt/fsmt-make-tiny-model.py", "repo_id": "transformers", "token_count": 704 }
328
# coding=utf-8 # Copyright 2018 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 copy of the License at # # http://www.a...
transformers/src/transformers/benchmark/benchmark.py/0
{ "file_path": "transformers/src/transformers/benchmark/benchmark.py", "repo_id": "transformers", "token_count": 4892 }
329
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/commands/serving.py/0
{ "file_path": "transformers/src/transformers/commands/serving.py", "repo_id": "transformers", "token_count": 3477 }
330
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in 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 th...
transformers/src/transformers/data/metrics/__init__.py/0
{ "file_path": "transformers/src/transformers/data/metrics/__init__.py", "repo_id": "transformers", "token_count": 1413 }
331
from abc import ABC, abstractmethod from typing import List, Optional class Constraint(ABC): r"""Abstract base class for all constraints that can be applied during generation. It must define how the constraint can be satisfied. All classes that inherit Constraint must follow the requirement that ```...
transformers/src/transformers/generation/beam_constraints.py/0
{ "file_path": "transformers/src/transformers/generation/beam_constraints.py", "repo_id": "transformers", "token_count": 8310 }
332