text stringlengths 7 328k | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 459 |
|---|---|---|---|
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/seamless_m4t/feature_extraction_seamless_m4t.py/0 | {
"file_path": "transformers/src/transformers/models/seamless_m4t/feature_extraction_seamless_m4t.py",
"repo_id": "transformers",
"token_count": 5746
} | 376 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/models/seggpt/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/seggpt/__init__.py",
"repo_id": "transformers",
"token_count": 860
} | 377 |
# 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/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/siglip/image_processing_siglip.py/0 | {
"file_path": "transformers/src/transformers/models/siglip/image_processing_siglip.py",
"repo_id": "transformers",
"token_count": 4986
} | 378 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/speech_to_text/processing_speech_to_text.py/0 | {
"file_path": "transformers/src/transformers/models/speech_to_text/processing_speech_to_text.py",
"repo_id": "transformers",
"token_count": 1792
} | 379 |
# 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 applicabl... | transformers/src/transformers/models/splinter/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/splinter/__init__.py",
"repo_id": "transformers",
"token_count": 927
} | 380 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/models/superpoint/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/superpoint/__init__.py",
"repo_id": "transformers",
"token_count": 847
} | 381 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/swin2sr/configuration_swin2sr.py/0 | {
"file_path": "transformers/src/transformers/models/swin2sr/configuration_swin2sr.py",
"repo_id": "transformers",
"token_count": 2786
} | 382 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/t5/convert_t5x_checkpoint_to_flax.py/0 | {
"file_path": "transformers/src/transformers/models/t5/convert_t5x_checkpoint_to_flax.py",
"repo_id": "transformers",
"token_count": 5106
} | 383 |
# coding=utf-8
# Copyright 2020 Google Research 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
#
# Unless re... | transformers/src/transformers/models/tapas/modeling_tapas.py/0 | {
"file_path": "transformers/src/transformers/models/tapas/modeling_tapas.py",
"repo_id": "transformers",
"token_count": 46115
} | 384 |
# coding=utf-8
# Copyright 2024 Microsoft Research and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | transformers/src/transformers/models/udop/modeling_udop.py/0 | {
"file_path": "transformers/src/transformers/models/udop/modeling_udop.py",
"repo_id": "transformers",
"token_count": 40224
} | 385 |
# coding=utf-8
# Copyright 2021 The Fairseq 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 the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | transformers/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py/0 | {
"file_path": "transformers/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py",
"repo_id": "transformers",
"token_count": 36855
} | 386 |
# coding=utf-8
# Copyright 2022 Multimedia Computing Group, Nanjing University 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... | transformers/src/transformers/models/videomae/modeling_videomae.py/0 | {
"file_path": "transformers/src/transformers/models/videomae/modeling_videomae.py",
"repo_id": "transformers",
"token_count": 20402
} | 387 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py/0 | {
"file_path": "transformers/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py",
"repo_id": "transformers",
"token_count": 14360
} | 388 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/vit/image_processing_vit.py/0 | {
"file_path": "transformers/src/transformers/models/vit/image_processing_vit.py",
"repo_id": "transformers",
"token_count": 6065
} | 389 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/vit_msn/convert_msn_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/vit_msn/convert_msn_to_pytorch.py",
"repo_id": "transformers",
"token_count": 4263
} | 390 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/vivit/configuration_vivit.py/0 | {
"file_path": "transformers/src/transformers/models/vivit/configuration_vivit.py",
"repo_id": "transformers",
"token_count": 2040
} | 391 |
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/wav2vec2_bert/convert_wav2vec2_seamless_checkpoint.py/0 | {
"file_path": "transformers/src/transformers/models/wav2vec2_bert/convert_wav2vec2_seamless_checkpoint.py",
"repo_id": "transformers",
"token_count": 3156
} | 392 |
# 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 applicabl... | transformers/src/transformers/models/whisper/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/whisper/__init__.py",
"repo_id": "transformers",
"token_count": 1768
} | 393 |
# coding=utf-8
# Copyright 2020 The Microsoft 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
#
# Unl... | transformers/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py/0 | {
"file_path": "transformers/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py",
"repo_id": "transformers",
"token_count": 3551
} | 394 |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/xlnet/convert_xlnet_original_tf_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/xlnet/convert_xlnet_original_tf_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 1468
} | 395 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/yoso/configuration_yoso.py/0 | {
"file_path": "transformers/src/transformers/models/yoso/configuration_yoso.py",
"repo_id": "transformers",
"token_count": 2641
} | 396 |
import uuid
import warnings
from typing import Any, Dict, List, Union
from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging
from .base import Pipeline, build_pipeline_init_args
if is_tf_available():
import tensorflow as tf
if is_torch_available():
import torch
logger = loggi... | transformers/src/transformers/pipelines/conversational.py/0 | {
"file_path": "transformers/src/transformers/pipelines/conversational.py",
"repo_id": "transformers",
"token_count": 5581
} | 397 |
import inspect
import warnings
from typing import Dict
import numpy as np
from ..utils import ExplicitEnum, add_end_docstrings, is_tf_available, is_torch_available
from .base import GenericTensor, Pipeline, build_pipeline_init_args
if is_tf_available():
from ..models.auto.modeling_tf_auto import TF_MODEL_FOR_SE... | transformers/src/transformers/pipelines/text_classification.py/0 | {
"file_path": "transformers/src/transformers/pipelines/text_classification.py",
"repo_id": "transformers",
"token_count": 4187
} | 398 |
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | transformers/src/transformers/quantizers/quantizer_awq.py/0 | {
"file_path": "transformers/src/transformers/quantizers/quantizer_awq.py",
"repo_id": "transformers",
"token_count": 1938
} | 399 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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/tools/__init__.py/0 | {
"file_path": "transformers/src/transformers/tools/__init__.py",
"repo_id": "transformers",
"token_count": 984
} | 400 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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/tools/translation.py/0 | {
"file_path": "transformers/src/transformers/tools/translation.py",
"repo_id": "transformers",
"token_count": 4126
} | 401 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class FlaxForcedBOSTokenLogitsProcessor(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
class FlaxForced... | transformers/src/transformers/utils/dummy_flax_objects.py/0 | {
"file_path": "transformers/src/transformers/utils/dummy_flax_objects.py",
"repo_id": "transformers",
"token_count": 14053
} | 402 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/utils/import_utils.py/0 | {
"file_path": "transformers/src/transformers/utils/import_utils.py",
"repo_id": "transformers",
"token_count": 19077
} | 403 |
<!---
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/templates/adding_a_new_model/README.md/0 | {
"file_path": "transformers/templates/adding_a_new_model/README.md",
"repo_id": "transformers",
"token_count": 2800
} | 404 |
Currently the following model proposals are available:
- <s>[BigBird (Google)](./ADD_BIG_BIRD.md)</s>
| transformers/templates/adding_a_new_model/open_model_proposals/README.md/0 | {
"file_path": "transformers/templates/adding_a_new_model/open_model_proposals/README.md",
"repo_id": "transformers",
"token_count": 34
} | 405 |
# 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 applicabl... | transformers/tests/models/albert/test_modeling_flax_albert.py/0 | {
"file_path": "transformers/tests/models/albert/test_modeling_flax_albert.py",
"repo_id": "transformers",
"token_count": 2643
} | 406 |
# 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/tests/models/auto/test_modeling_flax_auto.py/0 | {
"file_path": "transformers/tests/models/auto/test_modeling_flax_auto.py",
"repo_id": "transformers",
"token_count": 1758
} | 407 |
# coding=utf-8
# Copyright 2020 Ecole Polytechnique and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | transformers/tests/models/barthez/test_tokenization_barthez.py/0 | {
"file_path": "transformers/tests/models/barthez/test_tokenization_barthez.py",
"repo_id": "transformers",
"token_count": 2416
} | 408 |
# 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/LICENSE-2.0
#
# Unless ... | transformers/tests/models/blenderbot/test_modeling_blenderbot.py/0 | {
"file_path": "transformers/tests/models/blenderbot/test_modeling_blenderbot.py",
"repo_id": "transformers",
"token_count": 10024
} | 409 |
# 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 requir... | transformers/tests/models/camembert/test_modeling_tf_camembert.py/0 | {
"file_path": "transformers/tests/models/camembert/test_modeling_tf_camembert.py",
"repo_id": "transformers",
"token_count": 783
} | 410 |
import inspect
import tempfile
import unittest
import numpy as np
import transformers
from transformers import CLIPConfig, CLIPTextConfig, CLIPVisionConfig, is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax, slow
from ...test_modeling_flax_common import ... | transformers/tests/models/clip/test_modeling_flax_clip.py/0 | {
"file_path": "transformers/tests/models/clip/test_modeling_flax_clip.py",
"repo_id": "transformers",
"token_count": 11160
} | 411 |
# coding=utf-8
# 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 requir... | transformers/tests/models/codegen/test_tokenization_codegen.py/0 | {
"file_path": "transformers/tests/models/codegen/test_tokenization_codegen.py",
"repo_id": "transformers",
"token_count": 4929
} | 412 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/convnextv2/test_modeling_tf_convnextv2.py/0 | {
"file_path": "transformers/tests/models/convnextv2/test_modeling_tf_convnextv2.py",
"repo_id": "transformers",
"token_count": 5048
} | 413 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/data2vec/test_modeling_data2vec_vision.py/0 | {
"file_path": "transformers/tests/models/data2vec/test_modeling_data2vec_vision.py",
"repo_id": "transformers",
"token_count": 5932
} | 414 |
# 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 requir... | transformers/tests/models/distilbert/test_modeling_distilbert.py/0 | {
"file_path": "transformers/tests/models/distilbert/test_modeling_distilbert.py",
"repo_id": "transformers",
"token_count": 7895
} | 415 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/dpt/test_modeling_dpt.py/0 | {
"file_path": "transformers/tests/models/dpt/test_modeling_dpt.py",
"repo_id": "transformers",
"token_count": 6123
} | 416 |
# coding=utf-8
# Copyright 2021-2023 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | transformers/tests/models/encodec/test_feature_extraction_encodec.py/0 | {
"file_path": "transformers/tests/models/encodec/test_feature_extraction_encodec.py",
"repo_id": "transformers",
"token_count": 4914
} | 417 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/focalnet/test_modeling_focalnet.py/0 | {
"file_path": "transformers/tests/models/focalnet/test_modeling_focalnet.py",
"repo_id": "transformers",
"token_count": 7564
} | 418 |
# 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/LICENSE-2.0
#
# Unless r... | transformers/tests/models/gpt_neo/test_modeling_gpt_neo.py/0 | {
"file_path": "transformers/tests/models/gpt_neo/test_modeling_gpt_neo.py",
"repo_id": "transformers",
"token_count": 11505
} | 419 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/graphormer/test_modeling_graphormer.py/0 | {
"file_path": "transformers/tests/models/graphormer/test_modeling_graphormer.py",
"repo_id": "transformers",
"token_count": 45752
} | 420 |
# coding=utf-8
# Copyright 2021 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/models/imagegpt/test_image_processing_imagegpt.py/0 | {
"file_path": "transformers/tests/models/imagegpt/test_image_processing_imagegpt.py",
"repo_id": "transformers",
"token_count": 4306
} | 421 |
# coding=utf-8
# Copyright 2018 The Microsoft Research Asia LayoutLM Team Authors, The Hugging Face 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/license... | transformers/tests/models/layoutlm/test_tokenization_layoutlm.py/0 | {
"file_path": "transformers/tests/models/layoutlm/test_tokenization_layoutlm.py",
"repo_id": "transformers",
"token_count": 1080
} | 422 |
# 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/LICENSE-2.0
#
# Unless r... | transformers/tests/models/llava_next/test_modeling_llava_next.py/0 | {
"file_path": "transformers/tests/models/llava_next/test_modeling_llava_next.py",
"repo_id": "transformers",
"token_count": 9004
} | 423 |
# 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/LICENSE-2.0
#
# Unless r... | transformers/tests/models/m2m_100/test_modeling_m2m_100.py/0 | {
"file_path": "transformers/tests/models/m2m_100/test_modeling_m2m_100.py",
"repo_id": "transformers",
"token_count": 7707
} | 424 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/mask2former/test_modeling_mask2former.py/0 | {
"file_path": "transformers/tests/models/mask2former/test_modeling_mask2former.py",
"repo_id": "transformers",
"token_count": 7761
} | 425 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/tests/models/perceiver/test_tokenization_perceiver.py/0 | {
"file_path": "transformers/tests/models/perceiver/test_tokenization_perceiver.py",
"repo_id": "transformers",
"token_count": 6140
} | 426 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/poolformer/test_modeling_poolformer.py/0 | {
"file_path": "transformers/tests/models/poolformer/test_modeling_poolformer.py",
"repo_id": "transformers",
"token_count": 3675
} | 427 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/regnet/test_modeling_flax_regnet.py/0 | {
"file_path": "transformers/tests/models/regnet/test_modeling_flax_regnet.py",
"repo_id": "transformers",
"token_count": 3717
} | 428 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/sam/test_modeling_tf_sam.py/0 | {
"file_path": "transformers/tests/models/sam/test_modeling_tf_sam.py",
"repo_id": "transformers",
"token_count": 11717
} | 429 |
# coding=utf-8
# Copyright 2022 Google SwitchTransformers Authors and 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/tests/models/switch_transformers/test_modeling_switch_transformers.py/0 | {
"file_path": "transformers/tests/models/switch_transformers/test_modeling_switch_transformers.py",
"repo_id": "transformers",
"token_count": 21282
} | 430 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/vilt/test_modeling_vilt.py/0 | {
"file_path": "transformers/tests/models/vilt/test_modeling_vilt.py",
"repo_id": "transformers",
"token_count": 12049
} | 431 |
# 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 applicabl... | transformers/tests/models/vit/test_modeling_flax_vit.py/0 | {
"file_path": "transformers/tests/models/vit/test_modeling_flax_vit.py",
"repo_id": "transformers",
"token_count": 3243
} | 432 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/vits/test_modeling_vits.py/0 | {
"file_path": "transformers/tests/models/vits/test_modeling_vits.py",
"repo_id": "transformers",
"token_count": 8472
} | 433 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/wav2vec2_conformer/test_modeling_wav2vec2_conformer.py/0 | {
"file_path": "transformers/tests/models/wav2vec2_conformer/test_modeling_wav2vec2_conformer.py",
"repo_id": "transformers",
"token_count": 17966
} | 434 |
# 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/tests/optimization/test_optimization_tf.py/0 | {
"file_path": "transformers/tests/optimization/test_optimization_tf.py",
"repo_id": "transformers",
"token_count": 1782
} | 435 |
# 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 applicabl... | transformers/tests/pipelines/test_pipelines_mask_generation.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_mask_generation.py",
"repo_id": "transformers",
"token_count": 3309
} | 436 |
# 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 applicabl... | transformers/tests/pipelines/test_pipelines_zero_shot_object_detection.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_zero_shot_object_detection.py",
"repo_id": "transformers",
"token_count": 5064
} | 437 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/tests/repo_utils/test_get_test_info.py/0 | {
"file_path": "transformers/tests/repo_utils/test_get_test_info.py",
"repo_id": "transformers",
"token_count": 2131
} | 438 |
# coding=utf-8
# Copyright 2019 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/test_configuration_common.py/0 | {
"file_path": "transformers/tests/test_configuration_common.py",
"repo_id": "transformers",
"token_count": 2863
} | 439 |
# coding=utf-8
# Copyright 2019 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/test_tokenization_common.py/0 | {
"file_path": "transformers/tests/test_tokenization_common.py",
"repo_id": "transformers",
"token_count": 110762
} | 440 |
# coding=utf-8
# Copyright 2023 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/tools/test_text_to_speech.py/0 | {
"file_path": "transformers/tests/tools/test_text_to_speech.py",
"repo_id": "transformers",
"token_count": 745
} | 441 |
# 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 applicabl... | transformers/tests/utils/test_backbone_utils.py/0 | {
"file_path": "transformers/tests/utils/test_backbone_utils.py",
"repo_id": "transformers",
"token_count": 4934
} | 442 |
# coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | transformers/tests/utils/test_skip_decorators.py/0 | {
"file_path": "transformers/tests/utils/test_skip_decorators.py",
"repo_id": "transformers",
"token_count": 1214
} | 443 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/utils/check_support_list.py/0 | {
"file_path": "transformers/utils/check_support_list.py",
"repo_id": "transformers",
"token_count": 1443
} | 444 |
import argparse
import os
past_versions_testing = {
"pytorch": {
"1.13": {
"torch": "1.13.1",
"torchvision": "0.14.1",
"torchaudio": "0.13.1",
"python": 3.9,
"cuda": "cu116",
"install": (
"python3 -m pip install --no-c... | transformers/utils/past_ci_versions.py/0 | {
"file_path": "transformers/utils/past_ci_versions.py",
"repo_id": "transformers",
"token_count": 2774
} | 445 |
{
"opsets": {
"1": [
"Abs",
"Add",
"AddV2",
"ArgMax",
"ArgMin",
"AvgPool",
"AvgPool3D",
"BatchMatMul",
"BatchMatMulV2",
"BatchToSpaceND",
"BiasAdd",
"BiasAddV1",
... | transformers/utils/tf_ops/onnx.json/0 | {
"file_path": "transformers/utils/tf_ops/onnx.json",
"repo_id": "transformers",
"token_count": 4081
} | 446 |
export WANDB_ENTITY=huggingface
export WANDB_PROJECT=trl
bash $BENCHMARK_SCRIPT > output.txt
# Extract Job IDs into an array
job_ids=($(grep "Job ID:" output.txt | awk '{print $3}'))
# Extract WANDB_TAGS into an array
WANDB_TAGS=($(grep "WANDB_TAGS:" output.txt | awk '{print $2}'))
WANDB_TAGS=($(echo $WANDB_TAGS | tr... | trl/benchmark/benchmark_and_report.sh/0 | {
"file_path": "trl/benchmark/benchmark_and_report.sh",
"repo_id": "trl",
"token_count": 387
} | 447 |
- sections:
- local: index
title: TRL
- local: quickstart
title: Quickstart
- local: installation
title: Installation
- local: clis
title: Get started with Command Line Interfaces (CLIs)
- local: how_to_train
title: PPO Training FAQ
- local: use_model
title: Use Trained Models
- lo... | trl/docs/source/_toctree.yml/0 | {
"file_path": "trl/docs/source/_toctree.yml",
"repo_id": "trl",
"token_count": 522
} | 448 |
# Models
With the `AutoModelForCausalLMWithValueHead` class TRL supports all decoder model architectures in transformers such as GPT-2, OPT, and GPT-Neo. In addition, with `AutoModelForSeq2SeqLMWithValueHead` you can use encoder-decoder architectures such as T5. TRL also requires reference models which are frozen copi... | trl/docs/source/models.mdx/0 | {
"file_path": "trl/docs/source/models.mdx",
"repo_id": "trl",
"token_count": 283
} | 449 |
compute_environment: LOCAL_MACHINE
debug: false
distributed_type: MULTI_GPU
downcast_bf16: 'no'
gpu_ids: all
machine_rank: 0
main_training_function: main
mixed_precision: 'bf16'
num_machines: 1
num_processes: 8
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false... | trl/examples/accelerate_configs/multi_gpu.yaml/0 | {
"file_path": "trl/examples/accelerate_configs/multi_gpu.yaml",
"repo_id": "trl",
"token_count": 130
} | 450 |
# DPO pipeline for the creation of StackLlaMa 2: a Stack exchange llama-v2-7b model
## Prerequisites
Install all the dependencies in the `requirements.txt`:
```
$ pip install -U -r requirements.txt
```
Since we will use `accelerate` for training, make sure to run:
```
$ accelerate config
```
## Training
There wer... | trl/examples/research_projects/stack_llama_2/scripts/README.md/0 | {
"file_path": "trl/examples/research_projects/stack_llama_2/scripts/README.md",
"repo_id": "trl",
"token_count": 896
} | 451 |
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/scripts/ppo_multi_adapter.py/0 | {
"file_path": "trl/examples/scripts/ppo_multi_adapter.py",
"repo_id": "trl",
"token_count": 1997
} | 452 |
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/tests/test_cli.py/0 | {
"file_path": "trl/tests/test_cli.py",
"repo_id": "trl",
"token_count": 621
} | 453 |
# 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 applicabl... | trl/trl/models/modeling_value_head.py/0 | {
"file_path": "trl/trl/models/modeling_value_head.py",
"repo_id": "trl",
"token_count": 7975
} | 454 |
# 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 applicabl... | trl/trl/trainer/sft_trainer.py/0 | {
"file_path": "trl/trl/trainer/sft_trainer.py",
"repo_id": "trl",
"token_count": 11802
} | 455 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.