code
stringlengths
81
54k
code_codestyle
int64
0
721
style_context
stringlengths
91
41.9k
style_context_codestyle
int64
0
699
label
int64
0
1
'''simple docstring''' from __future__ import annotations from dataclasses import dataclass @dataclass class lowerCamelCase : '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = None lowerCAmelCase__ = None def __lowerCamelCase ( _Upp...
43
'''simple docstring''' import unittest from typing import Dict, List, Optional, Union import numpy as np from transformers.testing_utils import require_torch, require_vision from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMix...
43
1
'''simple docstring''' import math from typing import Dict, Iterable, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import normalize, rescale, resize, to_channel_dimension_format from ...image_utils import...
43
'''simple docstring''' from __future__ import annotations import os import tempfile import unittest import numpy as np from huggingface_hub import hf_hub_download from transformers import is_tensorflow_text_available, is_tf_available from transformers.testing_utils import require_tensorflow_text, require_tf, slow f...
43
1
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
'''simple docstring''' from collections.abc import Callable def __lowerCamelCase ( _UpperCamelCase : Callable[[float], float] , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = a UpperCAmelCase_ ...
43
1
'''simple docstring''' import datasets import faiss import numpy as np import streamlit as st import torch from elasticsearch import Elasticsearch from elia_utils import ( embed_questions_for_retrieval, make_qa_sas_model, qa_sas_generate, query_es_index, query_qa_dense_index, ) import transformers ...
43
'''simple docstring''' import re def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' return [char.split() for char in re.split(R'''[^ a-z A-Z 0-9 \s]''' , str_ )] def __lowerCamelCase ( _UpperCamelCase : str ): '''simple d...
43
1
'''simple docstring''' import unittest import numpy as np from transformers import is_flax_available from transformers.testing_utils import require_flax from ..test_modeling_flax_common import ids_tensor if is_flax_available(): import jax import jax.numpy as jnp from transformers.generation impo...
43
'''simple docstring''' import unittest import numpy as np import timeout_decorator # noqa from transformers import BlenderbotConfig, is_flax_available from transformers.testing_utils import jax_device, require_flax, slow from ...generation.test_flax_utils import FlaxGenerationTesterMixin from ...test_modeling_flax_...
43
1
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = ['''image_processor''', '''tokenizer'''] lowerCAmelCase__ ...
43
'''simple docstring''' import os import pytest from datasets import ( get_dataset_config_info, get_dataset_config_names, get_dataset_infos, get_dataset_split_names, inspect_dataset, inspect_metric, ) lowercase__ : Tuple = pytest.mark.integration @pytest.mark.parametrize('...
43
1
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : str = logging.get_logger(__name__) lowercase__ : Tuple = { "sayakpaul/vit-msn-base": "https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json", ...
43
'''simple docstring''' import collections import os import re from pathlib import Path lowercase__ : List[Any] = "src/transformers" # Matches is_xxx_available() lowercase__ : Optional[Any] = re.compile(R"is\_([a-z_]*)_available()") # Catches a one-line _import_struct = {xxx} lowerc...
43
1
'''simple docstring''' from ..utils import DummyObject, requires_backends class lowerCamelCase ( metaclass=lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = ['''flax''', '''transformers'''] def __init__( self : int , *UpperCAmelCase__ : ...
43
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : tuple[int, int] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = position UpperCAmelCase_ = [ ...
43
1
'''simple docstring''' from tempfile import TemporaryDirectory from unittest import TestCase from unittest.mock import MagicMock, patch from transformers import AutoModel, TFAutoModel from transformers.onnx import FeaturesManager from transformers.testing_utils import SMALL_MODEL_IDENTIFIER, require_tf, require_torch ...
43
'''simple docstring''' from __future__ import annotations from typing import TypedDict class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = 42 def __lowerCamelCase ( _UpperCamelCase : str ): ...
43
1
'''simple docstring''' # 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 # # Unles...
43
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Union[str, Any] = { "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_A...
43
1
'''simple docstring''' import os import tempfile import unittest from transformers import NezhaConfig, is_torch_available from transformers.models.auto import get_values from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device from ...generation.test_utils import GenerationTesterMix...
43
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
1
'''simple docstring''' from math import pi, sqrt, tan def __lowerCamelCase ( _UpperCamelCase : float ): '''simple docstring''' if side_length < 0: raise ValueError('''surface_area_cube() only accepts non-negative values''' ) return 6 * side_length**2 def __...
43
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Optional[Any] = { "configuration_encodec": [ "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", ]...
43
1
'''simple docstring''' from typing import Dict, List, Optional, Union import numpy as np from transformers.utils import is_vision_available from transformers.utils.generic import TensorType from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( cen...
43
'''simple docstring''' from heapq import heappop, heappush import numpy as np def __lowerCamelCase ( _UpperCamelCase : np.ndarray , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : bool , ): '''simple docstring'...
43
1
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : int , _UpperCamelCase : list ): '''simple docstring''' _enforce_args(_UpperCamelCase , _UpperCamelCase ) if n == 0: return 0 UpperCAmelCase_ = float('''-inf''' ...
43
'''simple docstring''' import json import os import unittest from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer from transformers.testing_utils import slow from ...test_tokenization_common import TokenizerTesterMixin class lowerCamelCase ( lowerCamelCase , unittest....
43
1
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : int = 1000 ): '''simple docstring''' UpperCAmelCase_ = 2**power UpperCAmelCase_ = str(_UpperCamelCase ) UpperCAmelCase_ = list(_UpperCamelCase ) UpperCAmelCase_...
43
'''simple docstring''' from datetime import datetime import matplotlib.pyplot as plt import torch def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] ): '''simple docstring''' for param in module.parameters(): UpperCAmelCase_ = False def __lowerCame...
43
1
'''simple docstring''' from __future__ import annotations import math def __lowerCamelCase ( _UpperCamelCase : int , _UpperCamelCase : int , _UpperCamelCase : bool , _UpperCamelCase : list[int] , _UpperCamelCase : float ): '''simple docstring''' ...
43
'''simple docstring''' import gc import unittest import numpy as np import torch from diffusers import StableDiffusionKDiffusionPipeline from diffusers.utils import slow, torch_device from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu enable_full_determinism() @slow @require...
43
1
'''simple docstring''' import argparse import json from collections import OrderedDict from pathlib import Path import requests import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import PoolFormerConfig, PoolFormerForImageClassification, PoolFormerImageProcessor from tran...
43
'''simple docstring''' import json import os import unittest from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, require_torch from transformers.utils import cach...
43
1
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str = "The quick brown fox jumps over the lazy dog" , ): '''simple docstring''' UpperCAmelCase_ = set() # Replace all the whitespace in our sentence UpperCAmelCase_ = input_str.rep...
43
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str , _UpperCamelCase : list[str] ): '''simple docstring''' UpperCAmelCase_ = '''''' for word_or_phrase in separated: if not isinstance(_UpperCamelCase , _UpperCamelCase ...
43
1
'''simple docstring''' import os import unittest from transformers import BertTokenizerFast from transformers.models.bert.tokenization_bert import ( VOCAB_FILES_NAMES, BasicTokenizer, BertTokenizer, WordpieceTokenizer, _is_control, _is_punctuation, _is_whitespace, ) from transformers.testin...
43
'''simple docstring''' import math from typing import Dict, Iterable, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import normalize, rescale, resize, to_channel_dimension_format from ...image_utils import...
43
1
'''simple docstring''' import os from shutil import copyfile from typing import Any, Dict, List, Optional, Tuple import sentencepiece as spm from ...tokenization_utils import AddedToken, PreTrainedTokenizer from ...utils import logging lowercase__ : Dict = logging.get_logger(__name__) lowercase__ ...
43
'''simple docstring''' from typing import List, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : int = logging.get_logger(__name__) lowercase__ : List[str] = { "huggingface/time-series-transformer-tourism-monthly": (...
43
1
'''simple docstring''' # 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 # # Unles...
43
'''simple docstring''' from ...utils import logging from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel from .configuration_mta import MTaConfig lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : List[Any] = "T5Config" class ...
43
1
'''simple docstring''' from __future__ import annotations from collections import deque from collections.abc import Sequence from dataclasses import dataclass from typing import Any @dataclass class lowerCamelCase : '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ ...
43
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets lowercase__ : str = datasets.logging.get_logger(__name__) lowercase__ : Dict = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha, Ana C and ...
43
1
'''simple docstring''' import math def __lowerCamelCase ( _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ = [] UpperCAmelCase_ = 2 UpperCAmelCase_ = int(math.sqrt(_UpperCamelCase ) ) # Size of every segment ...
43
'''simple docstring''' import unittest from typing import Dict, List, Optional, Union import numpy as np from transformers.testing_utils import require_torch, require_vision from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMix...
43
1
'''simple docstring''' import copy from dataclasses import dataclass, field from typing import ClassVar, Dict from ..features import Audio, ClassLabel, Features from .base import TaskTemplate @dataclass(frozen=lowerCamelCase ) class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' ...
43
'''simple docstring''' from __future__ import annotations import os import tempfile import unittest import numpy as np from huggingface_hub import hf_hub_download from transformers import is_tensorflow_text_available, is_tf_available from transformers.testing_utils import require_tensorflow_text, require_tf, slow f...
43
1
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : Tuple = logging.get_logger(__name__) lowercase__ : Optional[Any] = { "microsoft/swinv2-tiny-patch4-window8-256": ( "https://huggingface.co/microsoft/swin...
43
'''simple docstring''' from collections.abc import Callable def __lowerCamelCase ( _UpperCamelCase : Callable[[float], float] , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = a UpperCAmelCase_ ...
43
1
'''simple docstring''' import json import os import unittest from transformers.models.biogpt.tokenization_biogpt import VOCAB_FILES_NAMES, BioGptTokenizer from transformers.testing_utils import slow from ...test_tokenization_common import TokenizerTesterMixin class lowerCamelCase ( lowerCamelCase , ...
43
'''simple docstring''' import re def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' return [char.split() for char in re.split(R'''[^ a-z A-Z 0-9 \s]''' , str_ )] def __lowerCamelCase ( _UpperCamelCase : str ): '''simple d...
43
1
'''simple docstring''' from heapq import heappop, heappush import numpy as np def __lowerCamelCase ( _UpperCamelCase : np.ndarray , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : bool , ): '''simple docstring'...
43
'''simple docstring''' import unittest import numpy as np import timeout_decorator # noqa from transformers import BlenderbotConfig, is_flax_available from transformers.testing_utils import jax_device, require_flax, slow from ...generation.test_flax_utils import FlaxGenerationTesterMixin from ...test_modeling_flax_...
43
1
'''simple docstring''' import warnings from ...utils import logging from .image_processing_clip import CLIPImageProcessor lowercase__ : Union[str, Any] = logging.get_logger(__name__) class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' def __init__( self ...
43
'''simple docstring''' import os import pytest from datasets import ( get_dataset_config_info, get_dataset_config_names, get_dataset_infos, get_dataset_split_names, inspect_dataset, inspect_metric, ) lowercase__ : Tuple = pytest.mark.integration @pytest.mark.parametrize('...
43
1
'''simple docstring''' from __future__ import annotations from collections import namedtuple def __lowerCamelCase ( _UpperCamelCase : float , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = namedtuple('...
43
'''simple docstring''' import collections import os import re from pathlib import Path lowercase__ : List[Any] = "src/transformers" # Matches is_xxx_available() lowercase__ : Optional[Any] = re.compile(R"is\_([a-z_]*)_available()") # Catches a one-line _import_struct = {xxx} lowerc...
43
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_tf_available, is_torch_available, ) lowercase__ : Dict = { "configuration_speech_to_text": ["SPE...
43
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : tuple[int, int] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = position UpperCAmelCase_ = [ ...
43
1
'''simple docstring''' import unittest import numpy as np import torch from diffusers import ScoreSdeVePipeline, ScoreSdeVeScheduler, UNetaDModel from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device enable_full_determinism() class lowerCamelCase ( unittes...
43
'''simple docstring''' from __future__ import annotations from typing import TypedDict class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = 42 def __lowerCamelCase ( _UpperCamelCase : str ): ...
43
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Tuple = {"configuration_deit": ["DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeiTConfig"...
43
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Union[str, Any] = { "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_A...
43
1
'''simple docstring''' import unittest from parameterized import parameterized from transformers import LlamaConfig, is_torch_available, set_seed from transformers.testing_utils import require_torch, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common impor...
43
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
1
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : int , _UpperCamelCase : int ): '''simple docstring''' return x if y == 0 else greatest_common_divisor(_UpperCamelCase , x % y ) def __lowerCamelCase ( _UpperCamelCase : int , ...
43
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Optional[Any] = { "configuration_encodec": [ "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", ]...
43
1
'''simple docstring''' import json import os import unittest from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, require_torch from transformers.utils import cach...
43
'''simple docstring''' from heapq import heappop, heappush import numpy as np def __lowerCamelCase ( _UpperCamelCase : np.ndarray , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : bool , ): '''simple docstring'...
43
1
'''simple docstring''' from __future__ import annotations import math lowercase__ : Any = "2020.9.26" lowercase__ : Optional[Any] = "xcodz-dot, cclaus, dhruvmanila" def __lowerCamelCase ( _UpperCamelCase : float , _UpperCamelCase : float , _UpperC...
43
'''simple docstring''' import json import os import unittest from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer from transformers.testing_utils import slow from ...test_tokenization_common import TokenizerTesterMixin class lowerCamelCase ( lowerCamelCase , unittest....
43
1
'''simple docstring''' from ...utils import logging from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel from .configuration_mta import MTaConfig lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : List[Any] = "T5Config" class ...
43
'''simple docstring''' from datetime import datetime import matplotlib.pyplot as plt import torch def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] ): '''simple docstring''' for param in module.parameters(): UpperCAmelCase_ = False def __lowerCame...
43
1
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : Tuple ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = [], [] while len(_UpperCamelCase ) > 1: UpperCAmelCase_ , UpperCAmelCase_ = min(_UpperCamelCase ...
43
'''simple docstring''' import gc import unittest import numpy as np import torch from diffusers import StableDiffusionKDiffusionPipeline from diffusers.utils import slow, torch_device from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu enable_full_determinism() @slow @require...
43
1
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available lowercase__ : str = {"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]} try: if not is_torch_available():...
43
'''simple docstring''' import json import os import unittest from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, require_torch from transformers.utils import cach...
43
1
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets lowercase__ : Dict = datasets.logging.get_logger(__name__) lowercase__ : Dict = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha, Ana C and...
700
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str , _UpperCamelCase : list[str] ): '''simple docstring''' UpperCAmelCase_ = '''''' for word_or_phrase in separated: if not isinstance(_UpperCamelCase , _UpperCamelCase ...
43
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_torch_available, ) lowercase__ : Optional[Any] = {"configuration_unispeech": ["UNISPEECH_PRETRAINED_CONFI...
701
'''simple docstring''' import math from typing import Dict, Iterable, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import normalize, rescale, resize, to_channel_dimension_format from ...image_utils import...
43
0
'''simple docstring''' from graphs.minimum_spanning_tree_kruskal import kruskal def __lowerCamelCase ( ): '''simple docstring''' UpperCAmelCase_ = 9 UpperCAmelCase_ = [ [0, 1, 4], [0, 7, 8], [1, 2, 8], [7, 8, 7], ...
702
'''simple docstring''' from typing import List, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : int = logging.get_logger(__name__) lowercase__ : List[str] = { "huggingface/time-series-transformer-tourism-monthly": (...
43
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : Optional[int] = { "microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json", #...
703
'''simple docstring''' from ...utils import logging from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel from .configuration_mta import MTaConfig lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : List[Any] = "T5Config" class ...
43
0
'''simple docstring''' from io import BytesIO from typing import List, Union import requests from ..utils import add_end_docstrings, is_decord_available, is_torch_available, logging, requires_backends from .base import PIPELINE_INIT_ARGS, Pipeline if is_decord_available(): import numpy as np from decord...
704
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets lowercase__ : str = datasets.logging.get_logger(__name__) lowercase__ : Dict = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha, Ana C and ...
43
0
'''simple docstring''' import builtins import sys from ...utils.imports import _is_package_available from . import cursor, input from .helpers import Direction, clear_line, forceWrite, linebreak, move_cursor, reset_cursor, writeColor from .keymap import KEYMAP lowercase__ : Union[str, Any] = False t...
705
'''simple docstring''' import unittest from typing import Dict, List, Optional, Union import numpy as np from transformers.testing_utils import require_torch, require_vision from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMix...
43
0
'''simple docstring''' import json import os import shutil import tempfile import unittest from multiprocessing import get_context from pathlib import Path import datasets import numpy as np from datasets import load_dataset from parameterized import parameterized from transformers import AutoProcessor from transform...
706
'''simple docstring''' from __future__ import annotations import os import tempfile import unittest import numpy as np from huggingface_hub import hf_hub_download from transformers import is_tensorflow_text_available, is_tf_available from transformers.testing_utils import require_tensorflow_text, require_tf, slow f...
43
0
'''simple docstring''' import gc import unittest from diffusers import FlaxStableDiffusionInpaintPipeline from diffusers.utils import is_flax_available, load_image, slow from diffusers.utils.testing_utils import require_flax if is_flax_available(): import jax import jax.numpy as jnp from flax.jax_utils import rep...
707
'''simple docstring''' from collections.abc import Callable def __lowerCamelCase ( _UpperCamelCase : Callable[[float], float] , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = a UpperCAmelCase_ ...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : Tuple ): '''simple docstring''' UpperCAmelCase_ = 0 UpperCAmelCase_ = len(__A ) for i in range(n - 1 ): for j in range(i + 1 , __A ): ...
708
'''simple docstring''' import re def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' return [char.split() for char in re.split(R'''[^ a-z A-Z 0-9 \s]''' , str_ )] def __lowerCamelCase ( _UpperCamelCase : str ): '''simple d...
43
0
lowercase__ : Optional[Any] = { 'A': ['B', 'C', 'E'], 'B': ['A', 'D', 'E'], 'C': ['A', 'F', 'G'], 'D': ['B'], 'E': ['A', 'B', 'D'], 'F': ['C'], 'G': ['C'], } def __lowerCamelCase ( _UpperCamelCase : dict , _UpperCamelCase : Tuple , _Upper...
709
'''simple docstring''' import unittest import numpy as np import timeout_decorator # noqa from transformers import BlenderbotConfig, is_flax_available from transformers.testing_utils import jax_device, require_flax, slow from ...generation.test_flax_utils import FlaxGenerationTesterMixin from ...test_modeling_flax_...
43
0
'''simple docstring''' import argparse import os import torch from diffusers import ( CMStochasticIterativeScheduler, ConsistencyModelPipeline, UNetaDModel, ) lowercase__ : Tuple = { "sample_size": 32, "in_channels": 3, "out_channels": 3, "layers_per_block": 2, "num_...
710
'''simple docstring''' import os import pytest from datasets import ( get_dataset_config_info, get_dataset_config_names, get_dataset_infos, get_dataset_split_names, inspect_dataset, inspect_metric, ) lowercase__ : Tuple = pytest.mark.integration @pytest.mark.parametrize('...
43
0
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : list[int] , _UpperCamelCase : int ): '''simple docstring''' if len(_lowerCAmelCase ) == 0: return False UpperCAmelCase_ = len(_lowerCAmelCa...
711
'''simple docstring''' import collections import os import re from pathlib import Path lowercase__ : List[Any] = "src/transformers" # Matches is_xxx_available() lowercase__ : Optional[Any] = re.compile(R"is\_([a-z_]*)_available()") # Catches a one-line _import_struct = {xxx} lowerc...
43
0
'''simple docstring''' import contextlib import os import sqlitea import pytest from datasets import Dataset, Features, Value from datasets.io.sql import SqlDatasetReader, SqlDatasetWriter from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases, require_sqlalchemy def __lowerCamelC...
712
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : tuple[int, int] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = position UpperCAmelCase_ = [ ...
43
0
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : Optional[Any] , _UpperCamelCase : int ): '''simple docstring''' if nth_term == "": return [""] UpperCAmelCase_ = int(__UpperCAmelCase ) ...
713
'''simple docstring''' from __future__ import annotations from typing import TypedDict class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = 42 def __lowerCamelCase ( _UpperCamelCase : str ): ...
43
0
'''simple docstring''' lowercase__ : List[Any] = { "joule": 1.0, "kilojoule": 1000, "megajoule": 100_0000, "gigajoule": 10_0000_0000, "wattsecond": 1.0, "watthour": 3600, "kilowatthour": 360_0000, "newtonmeter": 1.0, "calorie_nutr": 4186.8, "kilocalorie_nutr": 418_6800....
714
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Union[str, Any] = { "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_A...
43
0
'''simple docstring''' import os import zipfile import requests from get_ci_error_statistics import download_artifact, get_artifacts_links def __lowerCamelCase ( _UpperCamelCase : Tuple , _UpperCamelCase : Optional[Any]=7 ): '''simple docstring''' UpperCAmelCase_ ...
715
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
0
'''simple docstring''' from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels from .squad import SquadExample, SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features from .utils import DataProcessor, InputExample, InputFeatures, Sing...
716
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Optional[Any] = { "configuration_encodec": [ "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", ]...
43
0
'''simple docstring''' import gc import unittest import numpy as np import torch import torch.nn.functional as F from transformers import ( ClapTextConfig, ClapTextModelWithProjection, RobertaTokenizer, SpeechTaHifiGan, SpeechTaHifiGanConfig, ) from diffusers import ( AudioLDMPipeline, Aut...
717
'''simple docstring''' from heapq import heappop, heappush import numpy as np def __lowerCamelCase ( _UpperCamelCase : np.ndarray , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : bool , ): '''simple docstring'...
43
0
'''simple docstring''' import argparse import json from pathlib import Path import torch import torchaudio from datasets import load_dataset from huggingface_hub import hf_hub_download from transformers import ASTConfig, ASTFeatureExtractor, ASTForAudioClassification from transformers.utils import logging logging.s...
718
'''simple docstring''' import json import os import unittest from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer from transformers.testing_utils import slow from ...test_tokenization_common import TokenizerTesterMixin class lowerCamelCase ( lowerCamelCase , unittest....
43
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_torch_available, ) lowercase__ : List[str] = { '''configuration_resnet''': ['''RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP'...
719
'''simple docstring''' from datetime import datetime import matplotlib.pyplot as plt import torch def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] ): '''simple docstring''' for param in module.parameters(): UpperCAmelCase_ = False def __lowerCame...
43
0
'''simple docstring''' from abc import ABC, abstractmethod from typing import List, Optional class lowerCamelCase ( _a ): '''simple docstring''' def __init__( self : Tuple ) ->Tuple: # test for the above condition self.test() def lowerCAmelCase__ ( ...
720
'''simple docstring''' import gc import unittest import numpy as np import torch from diffusers import StableDiffusionKDiffusionPipeline from diffusers.utils import slow, torch_device from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu enable_full_determinism() @slow @require...
43
0
'''simple docstring''' import unittest import numpy as np from transformers.testing_utils import require_pytesseract, require_torch from transformers.utils import is_pytesseract_available, is_torch_available from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs if is_torc...
721
'''simple docstring''' import json import os import unittest from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, require_torch from transformers.utils import cach...
43
0
'''simple docstring''' from json import JSONDecodeError # Workaround for requests.exceptions.JSONDecodeError import requests def __lowerCamelCase ( _UpperCamelCase : str = "isbn/0140328726" ): '''simple docstring''' UpperCAmelCase_ = olid.strip().strip('''/''' ) #...
700
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str , _UpperCamelCase : list[str] ): '''simple docstring''' UpperCAmelCase_ = '''''' for word_or_phrase in separated: if not isinstance(_UpperCamelCase , _UpperCamelCase ...
43
0
'''simple docstring''' import secrets from random import shuffle from string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, punctuation def __lowerCamelCase ( _UpperCamelCase : int = 8 ): '''simple docstring''' UpperCAmelCase_ = ascii_letter...
701
'''simple docstring''' import math from typing import Dict, Iterable, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import normalize, rescale, resize, to_channel_dimension_format from ...image_utils import...
43
0
'''simple docstring''' import os from shutil import copyfile from typing import Any, Dict, List, Optional, Tuple import sentencepiece as spm from ...tokenization_utils import AddedToken, BatchEncoding, PreTrainedTokenizer from ...utils import logging lowercase__ : List[str] = logging.get_logger(__...
702
'''simple docstring''' from typing import List, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : int = logging.get_logger(__name__) lowercase__ : List[str] = { "huggingface/time-series-transformer-tourism-monthly": (...
43
0
'''simple docstring''' import unittest import numpy as np from diffusers import OnnxStableDiffusionInpaintPipelineLegacy from diffusers.utils.testing_utils import ( is_onnx_available, load_image, load_numpy, nightly, require_onnxruntime, require_torch_gpu, ) if is_onnx_available(): impo...
703
'''simple docstring''' from ...utils import logging from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel from .configuration_mta import MTaConfig lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : List[Any] = "T5Config" class ...
43
0
'''simple docstring''' import gc import unittest from diffusers import FlaxControlNetModel, FlaxStableDiffusionControlNetPipeline from diffusers.utils import is_flax_available, load_image, slow from diffusers.utils.testing_utils import require_flax if is_flax_available(): import jax import jax.numpy as j...
704
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets lowercase__ : str = datasets.logging.get_logger(__name__) lowercase__ : Dict = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha, Ana C and ...
43
0
'''simple docstring''' import torch from diffusers import CMStochasticIterativeScheduler from .test_schedulers import SchedulerCommonTest class lowerCamelCase ( __SCREAMING_SNAKE_CASE ): '''simple docstring''' lowerCAmelCase__ = (CMStochasticIterativeScheduler,) lowerCAmelCase__...
705
'''simple docstring''' import unittest from typing import Dict, List, Optional, Union import numpy as np from transformers.testing_utils import require_torch, require_vision from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMix...
43
0
'''simple docstring''' import json from typing import List, Optional, Tuple from tokenizers import normalizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_distilbert import DistilBertTokenizer lowercase__ : List[Any] = logging.get_l...
706
'''simple docstring''' from __future__ import annotations import os import tempfile import unittest import numpy as np from huggingface_hub import hf_hub_download from transformers import is_tensorflow_text_available, is_tf_available from transformers.testing_utils import require_tensorflow_text, require_tf, slow f...
43
0
'''simple docstring''' import requests def __lowerCamelCase ( _UpperCamelCase : Any , _UpperCamelCase : List[str] ): '''simple docstring''' UpperCAmelCase_ = {'''Content-Type''': '''application/json'''} UpperCAmelCase_ = requests.post(__snake...
707
'''simple docstring''' from collections.abc import Callable def __lowerCamelCase ( _UpperCamelCase : Callable[[float], float] , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = a UpperCAmelCase_ ...
43
0
'''simple docstring''' import argparse import torch from torch import nn from transformers import MaMaaaConfig, MaMaaaForConditionalGeneration def __lowerCamelCase ( _UpperCamelCase : Tuple ): '''simple docstring''' UpperCAmelCase_ = [ """encoder.version""", ...
708
'''simple docstring''' import re def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' return [char.split() for char in re.split(R'''[^ a-z A-Z 0-9 \s]''' , str_ )] def __lowerCamelCase ( _UpperCamelCase : str ): '''simple d...
43
0
import numpy as np from cva import destroyAllWindows, imread, imshow, waitKey class lowerCamelCase : '''simple docstring''' def __init__( self : Dict , UpperCAmelCase__ : List[str] , UpperCAmelCase__ : List[str] , UpperCAmelCase__ : Optio...
709
'''simple docstring''' import unittest import numpy as np import timeout_decorator # noqa from transformers import BlenderbotConfig, is_flax_available from transformers.testing_utils import jax_device, require_flax, slow from ...generation.test_flax_utils import FlaxGenerationTesterMixin from ...test_modeling_flax_...
43
0
'''simple docstring''' import copy import os import cva import numpy as np from matplotlib import pyplot as plt class lowerCamelCase : '''simple docstring''' def __init__( self : List[str] ) ->List[str]: UpperCAmelCase_ = '''''' UpperCAmelCase_ ...
710
'''simple docstring''' import os import pytest from datasets import ( get_dataset_config_info, get_dataset_config_names, get_dataset_infos, get_dataset_split_names, inspect_dataset, inspect_metric, ) lowercase__ : Tuple = pytest.mark.integration @pytest.mark.parametrize('...
43
0
'''simple docstring''' import inspect import unittest from transformers import ViTConfig from transformers.testing_utils import ( require_accelerate, require_torch, require_torch_gpu, require_vision, slow, torch_device, ) from transformers.utils import cached_property, is_torch_available, is_vi...
711
'''simple docstring''' import collections import os import re from pathlib import Path lowercase__ : List[Any] = "src/transformers" # Matches is_xxx_available() lowercase__ : Optional[Any] = re.compile(R"is\_([a-z_]*)_available()") # Catches a one-line _import_struct = {xxx} lowerc...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str , _UpperCamelCase : List[Any] ): '''simple docstring''' assert x is not None assert y is not None UpperCAmelCase_ = len(_lowercase ) UpperCAmelCase_ = len(_lowe...
712
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : tuple[int, int] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = position UpperCAmelCase_ = [ ...
43
0
'''simple docstring''' import argparse import json import logging import os import shutil import sys import tempfile import unittest from unittest import mock import torch from accelerate.utils import write_basic_config from transformers.testing_utils import TestCasePlus, get_gpu_count, run_command, slow, torch_devic...
713
'''simple docstring''' from __future__ import annotations from typing import TypedDict class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = 42 def __lowerCamelCase ( _UpperCamelCase : str ): ...
43
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices lowercase__ : Union[str, Any] = logging.get_logger(__name__) lowercase__ : Optional[Any] = { ...
714
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Union[str, Any] = { "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_A...
43
0
'''simple docstring''' from typing import List, Optional, Tuple, Union import torch from ...models import UNetaDModel from ...schedulers import KarrasVeScheduler from ...utils import randn_tensor from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput class lowerCamelCase ( lowercase__ ):...
715
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
0
'''simple docstring''' from abc import ABC, abstractmethod from typing import Optional, Union from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit from ..utils.typing import NestedDataStructureLike, PathLike class lowerCamelCase ( __snake_case ): '''sim...
716
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Optional[Any] = { "configuration_encodec": [ "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", ]...
43
0
'''simple docstring''' import pickle import shutil import tempfile import unittest from transformers import SPIECE_UNDERLINE, XLMRobertaTokenizer, XLMRobertaTokenizerFast from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow from transformers.utils import cached_property...
717
'''simple docstring''' from heapq import heappop, heappush import numpy as np def __lowerCamelCase ( _UpperCamelCase : np.ndarray , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : tuple[int, int] , _UpperCamelCase : bool , ): '''simple docstring'...
43
0
'''simple docstring''' from __future__ import annotations from decimal import Decimal from math import * # noqa: F403 from sympy import diff def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] , _UpperCamelCase : Optional[int] , _UpperCamelCase : str = 10**-10 ): ...
718
'''simple docstring''' import json import os import unittest from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer from transformers.testing_utils import slow from ...test_tokenization_common import TokenizerTesterMixin class lowerCamelCase ( lowerCamelCase , unittest....
43
0
'''simple docstring''' import argparse import os import re lowercase__ : Optional[Any] = "src/diffusers" # Pattern that looks at the indentation in a line. lowercase__ : Any = re.compile(R"^(\s*)\S") # Pattern that matches `"key":" and puts `key` in group 0. lowercase__ : Tuple ...
719
'''simple docstring''' from datetime import datetime import matplotlib.pyplot as plt import torch def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] ): '''simple docstring''' for param in module.parameters(): UpperCAmelCase_ = False def __lowerCame...
43
0
'''simple docstring''' import unittest from knapsack import greedy_knapsack as kp class lowerCamelCase ( unittest.TestCase ): '''simple docstring''' def lowerCAmelCase__ ( self : Optional[int] ) ->Union[str, Any]: UpperCAmelCase_ = [10, 20, 30, 40, 50, ...
720
'''simple docstring''' import gc import unittest import numpy as np import torch from diffusers import StableDiffusionKDiffusionPipeline from diffusers.utils import slow, torch_device from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu enable_full_determinism() @slow @require...
43
0
'''simple docstring''' import itertools from dataclasses import dataclass from typing import List, Optional import pyarrow as pa import pyarrow.parquet as pq import datasets from datasets.table import table_cast lowercase__ : Any = datasets.utils.logging.get_logger(__name__) @dataclass class...
721
'''simple docstring''' import json import os import unittest from transformers import BatchEncoding, MvpTokenizer, MvpTokenizerFast from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers, require_torch from transformers.utils import cach...
43
0
'''simple docstring''' import json import pathlib import unittest import numpy as np from transformers.testing_utils import require_torch, require_vision, slow from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_im...
700
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str , _UpperCamelCase : list[str] ): '''simple docstring''' UpperCAmelCase_ = '''''' for word_or_phrase in separated: if not isinstance(_UpperCamelCase , _UpperCamelCase ...
43
0
'''simple docstring''' from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class lowerCamelCase ( __snake_case ): '''simple docstring''' lowerCAmelCase__ = ['''image_processor''', '''tokenizer'''] lowerCAmelCase__...
701
'''simple docstring''' import math from typing import Dict, Iterable, List, Optional, Tuple, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import normalize, rescale, resize, to_channel_dimension_format from ...image_utils import...
43
0
'''simple docstring''' import torch def __lowerCamelCase ( ): '''simple docstring''' if torch.cuda.is_available(): UpperCAmelCase_ = torch.cuda.device_count() else: UpperCAmelCase_ = 0 print(F"""Successfully ran on {num_gpus} GP...
702
'''simple docstring''' from typing import List, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : int = logging.get_logger(__name__) lowercase__ : List[str] = { "huggingface/time-series-transformer-tourism-monthly": (...
43
0
'''simple docstring''' from __future__ import annotations import math import random from collections.abc import Collection from typing import overload class lowerCamelCase : '''simple docstring''' def __init__( self : Any , UpperCAmelCase__ : List[Any] = None ) -...
703
'''simple docstring''' from ...utils import logging from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel from .configuration_mta import MTaConfig lowercase__ : Dict = logging.get_logger(__name__) lowercase__ : List[Any] = "T5Config" class ...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' UpperCAmelCase_ = hex_num.strip() if not hex_num: raise ValueError('''No value was passed to the function''' ) UpperCAmelCase_ = hex_num[...
704
'''simple docstring''' import comet # From: unbabel-comet import torch import datasets lowercase__ : str = datasets.logging.get_logger(__name__) lowercase__ : Dict = "\\n@inproceedings{rei-EtAl:2020:WMT,\n author = {Rei, Ricardo and Stewart, Craig and Farinha, Ana C and ...
43
0
'''simple docstring''' from dataclasses import dataclass from typing import Optional, Tuple, Union import flax import jax import jax.numpy as jnp from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils_flax import ( CommonSchedulerState, FlaxKarrasDiffusionSchedulers, Flax...
705
'''simple docstring''' import unittest from typing import Dict, List, Optional, Union import numpy as np from transformers.testing_utils import require_torch, require_vision from transformers.utils import is_torch_available, is_vision_available from ...test_image_processing_common import ImageProcessingSavingTestMix...
43
0
'''simple docstring''' import string def __lowerCamelCase ( _UpperCamelCase : List[Any] ): '''simple docstring''' UpperCAmelCase_ = "" for i in sequence: UpperCAmelCase_ = ord(lowercase_ ) if 65 <= extract <= 90: ...
706
'''simple docstring''' from __future__ import annotations import os import tempfile import unittest import numpy as np from huggingface_hub import hf_hub_download from transformers import is_tensorflow_text_available, is_tf_available from transformers.testing_utils import require_tensorflow_text, require_tf, slow f...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : Optional[int] , _UpperCamelCase : Optional[int] ): '''simple docstring''' return int((input_a, input_a).count(1 ) != 0 ) def __lowerCamelCase ( ): '''simple docstring''' as...
707
'''simple docstring''' from collections.abc import Callable def __lowerCamelCase ( _UpperCamelCase : Callable[[float], float] , _UpperCamelCase : float , _UpperCamelCase : float ): '''simple docstring''' UpperCAmelCase_ = a UpperCAmelCase_ ...
43
0
'''simple docstring''' import shutil import tempfile import unittest from transformers import ClapFeatureExtractor, ClapProcessor, RobertaTokenizer, RobertaTokenizerFast from transformers.testing_utils import require_sentencepiece, require_torchaudio from .test_feature_extraction_clap import floats_list @requi...
708
'''simple docstring''' import re def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' return [char.split() for char in re.split(R'''[^ a-z A-Z 0-9 \s]''' , str_ )] def __lowerCamelCase ( _UpperCamelCase : str ): '''simple d...
43
0
from typing import List, Optional, Union import numpy as np from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...feature_extraction_utils import BatchFeature from ...utils import PaddingStrategy, TensorType, logging lowercase__ : str = logging.get_logger(__name__) ...
709
'''simple docstring''' import unittest import numpy as np import timeout_decorator # noqa from transformers import BlenderbotConfig, is_flax_available from transformers.testing_utils import jax_device, require_flax, slow from ...generation.test_flax_utils import FlaxGenerationTesterMixin from ...test_modeling_flax_...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : int = 1000 ): '''simple docstring''' UpperCAmelCase_ = 3 UpperCAmelCase_ = 0 while a < n: if a % 3 == 0 or a % 5 == 0: result += a elif a % 15 =...
710
'''simple docstring''' import os import pytest from datasets import ( get_dataset_config_info, get_dataset_config_names, get_dataset_infos, get_dataset_split_names, inspect_dataset, inspect_metric, ) lowercase__ : Tuple = pytest.mark.integration @pytest.mark.parametrize('...
43
0
'''simple docstring''' def __lowerCamelCase ( _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ = int(lowerCamelCase_ ) if n_element < 1: UpperCAmelCase_ = ValueError('''a should be a positive number''' ) raise...
711
'''simple docstring''' import collections import os import re from pathlib import Path lowercase__ : List[Any] = "src/transformers" # Matches is_xxx_available() lowercase__ : Optional[Any] = re.compile(R"is\_([a-z_]*)_available()") # Catches a one-line _import_struct = {xxx} lowerc...
43
0
'''simple docstring''' import random import sys import numpy as np from matplotlib import pyplot as plt from matplotlib.colors import ListedColormap lowercase__ : Optional[Any] = "Usage of script: script_name <size_of_canvas:int>" lowercase__ : List[Any] = [0] * 100 + [1] * 10 rando...
712
'''simple docstring''' from __future__ import annotations def __lowerCamelCase ( _UpperCamelCase : tuple[int, int] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ = position UpperCAmelCase_ = [ ...
43
0
'''simple docstring''' import torch from diffusers import EulerDiscreteScheduler from diffusers.utils import torch_device from .test_schedulers import SchedulerCommonTest class lowerCamelCase ( __lowercase ): '''simple docstring''' lowerCAmelCase__ = (EulerDiscreteScheduler,) lo...
713
'''simple docstring''' from __future__ import annotations from typing import TypedDict class lowerCamelCase ( lowerCamelCase ): '''simple docstring''' lowerCAmelCase__ = 42 lowerCAmelCase__ = 42 def __lowerCamelCase ( _UpperCamelCase : str ): ...
43
0
'''simple docstring''' import unittest from transformers import SPIECE_UNDERLINE from transformers.models.speechta import SpeechTaTokenizer from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow from transformers.tokenization_utils import AddedToken from ...test_tokeniza...
714
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available, is_vision_available, ) lowercase__ : Union[str, Any] = { "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_A...
43
0
'''simple docstring''' import random def __lowerCamelCase ( _UpperCamelCase : Union[str, Any] , _UpperCamelCase : int ): '''simple docstring''' UpperCAmelCase_ , UpperCAmelCase_ , UpperCAmelCase_ = [], [], [] for element in data: ...
715
'''simple docstring''' lowercase__ : Union[str, Any] = "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n" lowercase__ : str = [{"type": "code", "con...
43
0
'''simple docstring''' import pytest from datasets import inspect_metric, list_metrics, load_metric @pytest.fixture def __lowerCamelCase ( _UpperCamelCase : str ): '''simple docstring''' monkeypatch.setattr('''datasets.utils.deprecation_utils._emitted_deprecation_warnings''' ...
716
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Optional[Any] = { "configuration_encodec": [ "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", ]...
43
0