text
stringlengths
7
1.24M
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
519
# Copyright (c) Microsoft Corporation and HuggingFace # Licensed under the MIT License. import cython cimport numpy from cython.parallel cimport parallel, prange import numpy as np # Reduce this number if matrices are too big for large graphs UNREACHABLE_NODE_DISTANCE = 510 def floyd_warshall(adjacency_matrix): ...
transformers/src/transformers/models/deprecated/graphormer/algos_graphormer.pyx/0
{ "file_path": "transformers/src/transformers/models/deprecated/graphormer/algos_graphormer.pyx", "repo_id": "transformers", "token_count": 1752 }
351
# 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/deprecated/mega/convert_mega_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/mega/convert_mega_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 4994 }
352
# coding=utf-8 # Copyright 2023 MURGe-Lab and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
transformers/src/transformers/models/deprecated/tvlt/configuration_tvlt.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/tvlt/configuration_tvlt.py", "repo_id": "transformers", "token_count": 3368 }
353
# 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/dpt/convert_dinov2_depth_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/dpt/convert_dinov2_depth_to_hf.py", "repo_id": "transformers", "token_count": 7345 }
354
# coding=utf-8 # Copyright 2022 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
transformers/src/transformers/models/ernie/configuration_ernie.py/0
{ "file_path": "transformers/src/transformers/models/ernie/configuration_ernie.py", "repo_id": "transformers", "token_count": 2935 }
355
# Copyright 2021 AlQuraishi Laboratory # Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
transformers/src/transformers/models/esm/openfold_utils/tensor_utils.py/0
{ "file_path": "transformers/src/transformers/models/esm/openfold_utils/tensor_utils.py", "repo_id": "transformers", "token_count": 1930 }
356
# 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/models/flaubert/__init__.py/0
{ "file_path": "transformers/src/transformers/models/flaubert/__init__.py", "repo_id": "transformers", "token_count": 1282 }
357
# coding=utf-8 # Copyright 2021 Google Research 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/LICE...
transformers/src/transformers/models/fnet/modeling_fnet.py/0
{ "file_path": "transformers/src/transformers/models/fnet/modeling_fnet.py", "repo_id": "transformers", "token_count": 20428 }
358
# coding=utf-8 # Copyright 2020-present Google Brain and Carnegie Mellon University 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.a...
transformers/src/transformers/models/funnel/modeling_tf_funnel.py/0
{ "file_path": "transformers/src/transformers/models/funnel/modeling_tf_funnel.py", "repo_id": "transformers", "token_count": 35085 }
359
# 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/gemma/tokenization_gemma_fast.py/0
{ "file_path": "transformers/src/transformers/models/gemma/tokenization_gemma_fast.py", "repo_id": "transformers", "token_count": 3337 }
360
# coding=utf-8 # Copyright 2022 KAIST and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
transformers/src/transformers/models/glpn/modeling_glpn.py/0
{ "file_path": "transformers/src/transformers/models/glpn/modeling_glpn.py", "repo_id": "transformers", "token_count": 13171 }
361
# coding=utf-8 # Copyright 2022 NVIDIA 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 # # Un...
transformers/src/transformers/models/groupvit/modeling_tf_groupvit.py/0
{ "file_path": "transformers/src/transformers/models/groupvit/modeling_tf_groupvit.py", "repo_id": "transformers", "token_count": 39571 }
362
# 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/idefics2/image_processing_idefics2.py/0
{ "file_path": "transformers/src/transformers/models/idefics2/image_processing_idefics2.py", "repo_id": "transformers", "token_count": 11662 }
363
import argparse from fairseq.checkpoint_utils import load_checkpoint_to_cpu from transformers import Kosmos2Config, Kosmos2ForConditionalGeneration KEYS_TO_MODIFY_MAPPING = { "gpt_model.decoder.output_projection": "text_model.lm_head", "gpt_model.decoder": "text_model.model", "img_connector": "image_to_...
transformers/src/transformers/models/kosmos2/convert_kosmos2_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/kosmos2/convert_kosmos2_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 1082 }
364
# 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/layoutlmv2/tokenization_layoutlmv2_fast.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py", "repo_id": "transformers", "token_count": 17324 }
365
# coding=utf-8 # Copyright 2021 Iz Beltagy, Matthew E. Peters, Arman Cohan 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://w...
transformers/src/transformers/models/led/modeling_led.py/0
{ "file_path": "transformers/src/transformers/models/led/modeling_led.py", "repo_id": "transformers", "token_count": 59398 }
366
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from <path_to_diff_file.py>. # Do NOT edit this file manually as any edits will be overwritten by the generation of # the file from the diff. If an...
transformers/src/transformers/models/llava_next_video/configuration_llava_next_video.py/0
{ "file_path": "transformers/src/transformers/models/llava_next_video/configuration_llava_next_video.py", "repo_id": "transformers", "token_count": 3194 }
367
# 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/LICENSE-2.0 # #...
transformers/src/transformers/models/m2m_100/convert_m2m100_original_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/m2m_100/convert_m2m100_original_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 1220 }
368
# coding=utf-8 # Copyright 2022 Meta Platforms, Inc.and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
transformers/src/transformers/models/maskformer/configuration_maskformer.py/0
{ "file_path": "transformers/src/transformers/models/maskformer/configuration_maskformer.py", "repo_id": "transformers", "token_count": 4081 }
369
# coding=utf-8 # Copyright 2020 The Facebook AI Research 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/LIC...
transformers/src/transformers/models/mbart/tokenization_mbart_fast.py/0
{ "file_path": "transformers/src/transformers/models/mbart/tokenization_mbart_fast.py", "repo_id": "transformers", "token_count": 4745 }
370
# 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 this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
transformers/src/transformers/models/mobilebert/modeling_mobilebert.py/0
{ "file_path": "transformers/src/transformers/models/mobilebert/modeling_mobilebert.py", "repo_id": "transformers", "token_count": 29596 }
371
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, 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. # You may obtain a copy of the License ...
transformers/src/transformers/models/mpnet/tokenization_mpnet_fast.py/0
{ "file_path": "transformers/src/transformers/models/mpnet/tokenization_mpnet_fast.py", "repo_id": "transformers", "token_count": 3633 }
372
# coding=utf-8 # Copyright 2022 UW-Madison 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 #...
transformers/src/transformers/models/nystromformer/modeling_nystromformer.py/0
{ "file_path": "transformers/src/transformers/models/nystromformer/modeling_nystromformer.py", "repo_id": "transformers", "token_count": 20569 }
373
# coding=utf-8 # Copyright 2018 The Open AI 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/src/transformers/models/openai/tokenization_openai.py/0
{ "file_path": "transformers/src/transformers/models/openai/tokenization_openai.py", "repo_id": "transformers", "token_count": 6841 }
374
# 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/owlvit/convert_owlvit_original_flax_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/owlvit/convert_owlvit_original_flax_to_hf.py", "repo_id": "transformers", "token_count": 6095 }
375
# 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/models/pegasus/__init__.py/0
{ "file_path": "transformers/src/transformers/models/pegasus/__init__.py", "repo_id": "transformers", "token_count": 1516 }
376
# coding=utf-8 # Copyright 2021 Deepmind and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
transformers/src/transformers/models/perceiver/modeling_perceiver.py/0
{ "file_path": "transformers/src/transformers/models/perceiver/modeling_perceiver.py", "repo_id": "transformers", "token_count": 63715 }
377
# 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/pix2struct/configuration_pix2struct.py/0
{ "file_path": "transformers/src/transformers/models/pix2struct/configuration_pix2struct.py", "repo_id": "transformers", "token_count": 6553 }
378
# 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/src/transformers/models/pop2piano/__init__.py/0
{ "file_path": "transformers/src/transformers/models/pop2piano/__init__.py", "repo_id": "transformers", "token_count": 1408 }
379
# coding=utf-8 # Copyright 2023 Authors: Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, # Kaitao Song, Ding Liang, Tong Lu, Ping Luo, Ling Shao 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...
transformers/src/transformers/models/pvt/modeling_pvt.py/0
{ "file_path": "transformers/src/transformers/models/pvt/modeling_pvt.py", "repo_id": "transformers", "token_count": 12174 }
380
# 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/src/transformers/models/roformer/modeling_roformer.py/0
{ "file_path": "transformers/src/transformers/models/roformer/modeling_roformer.py", "repo_id": "transformers", "token_count": 29844 }
381
# 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_encoder_decoder/convert_mbart_wav2vec2_seq2seq_original_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/speech_encoder_decoder/convert_mbart_wav2vec2_seq2seq_original_to_pytorch.py", "repo_id": "transformers", "token_count": 6577 }
382
# 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/speecht5/feature_extraction_speecht5.py/0
{ "file_path": "transformers/src/transformers/models/speecht5/feature_extraction_speecht5.py", "repo_id": "transformers", "token_count": 7605 }
383
import argparse import json import os import tensorstore as ts import torch from flax import serialization from flax.traverse_util import flatten_dict, unflatten_dict from tensorflow.io import gfile from transformers.modeling_utils import dtype_byte_size from transformers.models.switch_transformers.convert_switch_tra...
transformers/src/transformers/models/switch_transformers/convert_big_switch.py/0
{ "file_path": "transformers/src/transformers/models/switch_transformers/convert_big_switch.py", "repo_id": "transformers", "token_count": 3234 }
384
# 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/table_transformer/convert_table_transformer_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/table_transformer/convert_table_transformer_to_hf.py", "repo_id": "transformers", "token_count": 6591 }
385
# 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": 40498 }
386
# 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/video_llava/processing_video_llava.py/0
{ "file_path": "transformers/src/transformers/models/video_llava/processing_video_llava.py", "repo_id": "transformers", "token_count": 4443 }
387
# 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...
transformers/src/transformers/models/vipllava/convert_vipllava_weights_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/vipllava/convert_vipllava_weights_to_hf.py", "repo_id": "transformers", "token_count": 1889 }
388
# coding=utf-8 # Copyright 2021 The UCLA NLP 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/visual_bert/modeling_visual_bert.py/0
{ "file_path": "transformers/src/transformers/models/visual_bert/modeling_visual_bert.py", "repo_id": "transformers", "token_count": 29133 }
389
# coding=utf-8 # Copyright 2023 The Kakao Enterprise Authors, the MMS-TTS 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 # # h...
transformers/src/transformers/models/vits/tokenization_vits.py/0
{ "file_path": "transformers/src/transformers/models/vits/tokenization_vits.py", "repo_id": "transformers", "token_count": 3967 }
390
# 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/x_clip/convert_x_clip_original_pytorch_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/x_clip/convert_x_clip_original_pytorch_to_hf.py", "repo_id": "transformers", "token_count": 8829 }
391
# coding=utf-8 # Copyright 2019 The Open AI 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/src/transformers/models/xlm/tokenization_xlm.py/0
{ "file_path": "transformers/src/transformers/models/xlm/tokenization_xlm.py", "repo_id": "transformers", "token_count": 11004 }
392
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University 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 Lice...
transformers/src/transformers/models/xlnet/modeling_xlnet.py/0
{ "file_path": "transformers/src/transformers/models/xlnet/modeling_xlnet.py", "repo_id": "transformers", "token_count": 41724 }
393
# Copyright 2023 The HuggingFace Team. All rights reserved. import datetime import platform import subprocess from typing import Optional, Tuple, Union import numpy as np def ffmpeg_read(bpayload: bytes, sampling_rate: int) -> np.array: """ Helper function to read an audio file through ffmpeg. """ ar...
transformers/src/transformers/pipelines/audio_utils.py/0
{ "file_path": "transformers/src/transformers/pipelines/audio_utils.py", "repo_id": "transformers", "token_count": 4572 }
394
import collections import types import numpy as np from ..utils import ( add_end_docstrings, is_tf_available, is_torch_available, requires_backends, ) from .base import ArgumentHandler, Dataset, Pipeline, PipelineException, build_pipeline_init_args if is_torch_available(): import torch from...
transformers/src/transformers/pipelines/table_question_answering.py/0
{ "file_path": "transformers/src/transformers/pipelines/table_question_answering.py", "repo_id": "transformers", "token_count": 9176 }
395
# 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/base.py/0
{ "file_path": "transformers/src/transformers/quantizers/base.py", "repo_id": "transformers", "token_count": 3620 }
396
# 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/testing_utils.py/0
{ "file_path": "transformers/src/transformers/testing_utils.py", "repo_id": "transformers", "token_count": 34057 }
397
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/utils/bitsandbytes.py/0
{ "file_path": "transformers/src/transformers/utils/bitsandbytes.py", "repo_id": "transformers", "token_count": 303 }
398
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class AlbertTokenizerFast(metaclass=DummyObject): _backends = ["tokenizers"] def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) class BartTokenize...
transformers/src/transformers/utils/dummy_tokenizers_objects.py/0
{ "file_path": "transformers/src/transformers/utils/dummy_tokenizers_objects.py", "repo_id": "transformers", "token_count": 4439 }
399
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/agents/test_final_answer.py/0
{ "file_path": "transformers/tests/agents/test_final_answer.py", "repo_id": "transformers", "token_count": 935 }
400
{ "feature_extractor_type": "ViTFeatureExtractor", "size": 30 }
transformers/tests/deepspeed/vit_feature_extractor.json/0
{ "file_path": "transformers/tests/deepspeed/vit_feature_extractor.json", "repo_id": "transformers", "token_count": 32 }
401
# coding=utf-8 # Copyright 2022 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/tests/generation/test_configuration_utils.py/0
{ "file_path": "transformers/tests/generation/test_configuration_utils.py", "repo_id": "transformers", "token_count": 6248 }
402
# 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/auto/test_processor_auto.py/0
{ "file_path": "transformers/tests/models/auto/test_processor_auto.py", "repo_id": "transformers", "token_count": 9884 }
403
# coding=utf-8 # Copyright 2018 Salesforce 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 required by a...
transformers/tests/models/bertweet/test_tokenization_bertweet.py/0
{ "file_path": "transformers/tests/models/bertweet/test_tokenization_bertweet.py", "repo_id": "transformers", "token_count": 1145 }
404
#!/usr/bin/env python3 # 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/tests/models/blenderbot/test_tokenization_blenderbot.py/0
{ "file_path": "transformers/tests/models/blenderbot/test_tokenization_blenderbot.py", "repo_id": "transformers", "token_count": 1383 }
405
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 }
406
# 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/decision_transformer/test_modeling_decision_transformer.py/0
{ "file_path": "transformers/tests/models/decision_transformer/test_modeling_decision_transformer.py", "repo_id": "transformers", "token_count": 4149 }
407
# 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/dinov2/test_modeling_dinov2.py/0
{ "file_path": "transformers/tests/models/dinov2/test_modeling_dinov2.py", "repo_id": "transformers", "token_count": 5029 }
408
# coding=utf-8 # Copyright 2020 Huggingface # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file 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/tests/models/dpr/test_tokenization_dpr.py/0
{ "file_path": "transformers/tests/models/dpr/test_tokenization_dpr.py", "repo_id": "transformers", "token_count": 1358 }
409
# 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/encodec/test_modeling_encodec.py/0
{ "file_path": "transformers/tests/models/encodec/test_modeling_encodec.py", "repo_id": "transformers", "token_count": 11793 }
410
# 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/gemma2/test_modeling_gemma2.py/0
{ "file_path": "transformers/tests/models/gemma2/test_modeling_gemma2.py", "repo_id": "transformers", "token_count": 3517 }
411
# 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/idefics/test_image_processing_idefics.py/0
{ "file_path": "transformers/tests/models/idefics/test_image_processing_idefics.py", "repo_id": "transformers", "token_count": 3290 }
412
# 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/layoutlmv2/test_modeling_layoutlmv2.py/0
{ "file_path": "transformers/tests/models/layoutlmv2/test_modeling_layoutlmv2.py", "repo_id": "transformers", "token_count": 11384 }
413
# coding=utf-8 # Copyright 2018 LXMERT 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/licenses/LICENSE-2.0 # # Unless required b...
transformers/tests/models/lxmert/test_tokenization_lxmert.py/0
{ "file_path": "transformers/tests/models/lxmert/test_tokenization_lxmert.py", "repo_id": "transformers", "token_count": 1330 }
414
# 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/models/owlv2/test_image_processing_owlv2.py/0
{ "file_path": "transformers/tests/models/owlv2/test_image_processing_owlv2.py", "repo_id": "transformers", "token_count": 2717 }
415
# 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/pix2struct/test_modeling_pix2struct.py/0
{ "file_path": "transformers/tests/models/pix2struct/test_modeling_pix2struct.py", "repo_id": "transformers", "token_count": 15471 }
416
# 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/rembert/test_modeling_tf_rembert.py/0
{ "file_path": "transformers/tests/models/rembert/test_modeling_tf_rembert.py", "repo_id": "transformers", "token_count": 12938 }
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/roc_bert/test_modeling_roc_bert.py/0
{ "file_path": "transformers/tests/models/roc_bert/test_modeling_roc_bert.py", "repo_id": "transformers", "token_count": 13539 }
418
# 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/models/sam/test_processor_sam.py/0
{ "file_path": "transformers/tests/models/sam/test_processor_sam.py", "repo_id": "transformers", "token_count": 4944 }
419
# 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/sew/test_modeling_sew.py/0
{ "file_path": "transformers/tests/models/sew/test_modeling_sew.py", "repo_id": "transformers", "token_count": 10310 }
420
# 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/tests/models/superpoint/test_modeling_superpoint.py/0
{ "file_path": "transformers/tests/models/superpoint/test_modeling_superpoint.py", "repo_id": "transformers", "token_count": 5315 }
421
# coding=utf-8 # Copyright 2018 Google T5 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 # # Unless requ...
transformers/tests/models/t5/test_modeling_t5.py/0
{ "file_path": "transformers/tests/models/t5/test_modeling_t5.py", "repo_id": "transformers", "token_count": 34389 }
422
# 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/trocr/test_modeling_trocr.py/0
{ "file_path": "transformers/tests/models/trocr/test_modeling_trocr.py", "repo_id": "transformers", "token_count": 3182 }
423
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/univnet/test_modeling_univnet.py/0
{ "file_path": "transformers/tests/models/univnet/test_modeling_univnet.py", "repo_id": "transformers", "token_count": 5763 }
424
# coding=utf-8 # Copyright 2021 HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
transformers/tests/models/vision_encoder_decoder/test_modeling_flax_vision_encoder_decoder.py/0
{ "file_path": "transformers/tests/models/vision_encoder_decoder/test_modeling_flax_vision_encoder_decoder.py", "repo_id": "transformers", "token_count": 9445 }
425
# 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/vit_mae/test_modeling_tf_vit_mae.py/0
{ "file_path": "transformers/tests/models/vit_mae/test_modeling_tf_vit_mae.py", "repo_id": "transformers", "token_count": 8552 }
426
# 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/wav2vec2/test_feature_extraction_wav2vec2.py/0
{ "file_path": "transformers/tests/models/wav2vec2/test_feature_extraction_wav2vec2.py", "repo_id": "transformers", "token_count": 4355 }
427
# 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/wavlm/test_modeling_wavlm.py/0
{ "file_path": "transformers/tests/models/wavlm/test_modeling_wavlm.py", "repo_id": "transformers", "token_count": 11106 }
428
# 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/xlm/test_modeling_tf_xlm.py/0
{ "file_path": "transformers/tests/models/xlm/test_modeling_tf_xlm.py", "repo_id": "transformers", "token_count": 6409 }
429
# 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_depth_estimation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_depth_estimation.py", "repo_id": "transformers", "token_count": 1818 }
430
# 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/pipelines/test_pipelines_text_generation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_text_generation.py", "repo_id": "transformers", "token_count": 10128 }
431
# coding=utf-8 # Copyright 2022 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/tests/quantization/bnb/test_4bit.py/0
{ "file_path": "transformers/tests/quantization/bnb/test_4bit.py", "repo_id": "transformers", "token_count": 11437 }
432
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/repo_utils/test_check_docstrings.py/0
{ "file_path": "transformers/tests/repo_utils/test_check_docstrings.py", "repo_id": "transformers", "token_count": 1935 }
433
# 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/test_backbone_common.py/0
{ "file_path": "transformers/tests/test_backbone_common.py", "repo_id": "transformers", "token_count": 4375 }
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/trainer/test_data_collator.py/0
{ "file_path": "transformers/tests/trainer/test_data_collator.py", "repo_id": "transformers", "token_count": 47603 }
435
# 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/utils/test_configuration_utils.py/0
{ "file_path": "transformers/tests/utils/test_configuration_utils.py", "repo_id": "transformers", "token_count": 6485 }
436
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/utils/test_modeling_rope_utils.py/0
{ "file_path": "transformers/tests/utils/test_modeling_rope_utils.py", "repo_id": "transformers", "token_count": 10745 }
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/utils/check_doctest_list.py/0
{ "file_path": "transformers/utils/check_doctest_list.py", "repo_id": "transformers", "token_count": 1180 }
438
import argparse import math import traceback import dateutil.parser as date_parser import requests def extract_time_from_single_job(job): """Extract time info from a single job in a GitHub Actions workflow run""" job_info = {} start = job["started_at"] end = job["completed_at"] start_datetime ...
transformers/utils/get_github_job_time.py/0
{ "file_path": "transformers/utils/get_github_job_time.py", "repo_id": "transformers", "token_count": 835 }
439
# 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/update_tiny_models.py/0
{ "file_path": "transformers/utils/update_tiny_models.py", "repo_id": "transformers", "token_count": 3071 }
440
.PHONY: test precommit benchmark_core benchmark_aux common_tests slow_tests test_examples tests_gpu check_dirs := examples tests trl ACCELERATE_CONFIG_PATH = `pwd`/examples/accelerate_configs COMMAND_FILES_PATH = `pwd`/commands dev: [ -L "$(pwd)/trl/commands/scripts" ] && unlink "$(pwd)/trl/commands/scripts" || tr...
trl/Makefile/0
{ "file_path": "trl/Makefile", "repo_id": "trl", "token_count": 568 }
441
#!/bin/bash # This script runs an SFT example end-to-end on a tiny model using different possible configurations # but defaults to QLoRA + PEFT OUTPUT_DIR="test_sft/" MODEL_NAME="trl-internal-testing/tiny-random-LlamaForCausalLM" DATASET_NAME="imdb" MAX_STEPS=5 BATCH_SIZE=2 SEQ_LEN=128 # Handle extra arguments in cas...
trl/commands/run_sft.sh/0
{ "file_path": "trl/commands/run_sft.sh", "repo_id": "trl", "token_count": 636 }
442
<div style="text-align: center"> <img src="https://huggingface.co/datasets/trl-internal-testing/example-images/resolve/main/images/trl_banner_dark.png"> </div> # TRL - Transformer Reinforcement Learning TRL is a full stack library where we provide a set of tools to train transformer language models with Reinforcement...
trl/docs/source/index.mdx/0
{ "file_path": "trl/docs/source/index.mdx", "repo_id": "trl", "token_count": 1553 }
443
import sys from dataclasses import dataclass, field from typing import Optional from datasets import Dataset, DatasetDict from huggingface_hub import HfApi, hf_hub_download from huggingface_hub.repocard import RepoCard from transformers import AutoTokenizer, HfArgumentParser """ # debug python -i examples/datasets/s...
trl/examples/datasets/sentiment_descriptiveness.py/0
{ "file_path": "trl/examples/datasets/sentiment_descriptiveness.py", "repo_id": "trl", "token_count": 3107 }
444
# flake8: noqa # 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...
trl/examples/scripts/dpo_visual.py/0
{ "file_path": "trl/examples/scripts/dpo_visual.py", "repo_id": "trl", "token_count": 2678 }
445
# 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...
trl/scripts/log_reports.py/0
{ "file_path": "trl/scripts/log_reports.py", "repo_id": "trl", "token_count": 2727 }
446
import unittest from typing import Callable from datasets import Dataset, load_dataset from transformers import AutoModelForCausalLM, AutoTokenizer from trl.extras.dataset_formatting import get_formatting_func_from_dataset from trl.models.utils import ChatMlSpecialTokens, setup_chat_format class DatasetFormattingTe...
trl/tests/test_dataset_formatting.py/0
{ "file_path": "trl/tests/test_dataset_formatting.py", "repo_id": "trl", "token_count": 3064 }
447
import tempfile import unittest import torch import torch.nn as nn from datasets import Dataset from transformers import Trainer, TrainingArguments from trl.trainer.callbacks import RichProgressCallback class DummyModel(nn.Module): def __init__(self): super().__init__() self.a = nn.Parameter(tor...
trl/tests/test_rich_progress_callback.py/0
{ "file_path": "trl/tests/test_rich_progress_callback.py", "repo_id": "trl", "token_count": 829 }
448
from typing import Any, Callable, List, Optional, Union import torch from transformers import GenerationConfig, PreTrainedTokenizer, PreTrainedTokenizerFast from ..core import set_seed from ..models import SUPPORTED_ARCHITECTURES, PreTrainedModelWrapper class BestOfNSampler: def __init__( self, ...
trl/trl/extras/best_of_n_sampler.py/0
{ "file_path": "trl/trl/extras/best_of_n_sampler.py", "repo_id": "trl", "token_count": 2253 }
449
# 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/trainer/callbacks.py/0
{ "file_path": "trl/trl/trainer/callbacks.py", "repo_id": "trl", "token_count": 5294 }
450