code
stringlengths
86
54.5k
code_codestyle
int64
0
371
style_context
stringlengths
87
49.2k
style_context_codestyle
int64
0
349
label
int64
0
1
'''simple docstring''' from __future__ import annotations from collections.abc import MutableSequence class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ ): '''simple docstring''' if len(snake_case_ ...
368
'''simple docstring''' from typing import List, Optional from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''huggingface/autoformer-tourism-monthly''':...
274
0
'''simple docstring''' from math import ceil def _lowerCamelCase ( lowerCamelCase_ : int = 1001 ): """simple docstring""" UpperCAmelCase_ : List[Any] = 1 for i in range(1 , int(ceil(n / 2.0 ) ) ): UpperCAmelCase_ ...
369
'''simple docstring''' import unittest from transformers.utils.backbone_utils import ( BackboneMixin, get_aligned_output_features_output_indices, verify_out_features_out_indices, ) class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelC...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return int(input_a == input_a == 0 ) def _lowerCamelCase ( ): """simple docstring""" print('Truth Table of NOR Gate:' ...
370
'''simple docstring''' import numpy as np import torch from torch.nn import CrossEntropyLoss from transformers import AutoModelForCausalLM, AutoTokenizer import datasets from datasets import logging snake_case__ : str = '''\ ''' snake_case__ : Union[str, Any] = ''' Perplexit...
274
0
'''simple docstring''' import copy from typing import Any, Dict, List, Optional, Union import numpy as np import torch from ...audio_utils import mel_filter_bank, spectrogram, window_function from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...feature_extraction_utils import BatchFeatu...
371
'''simple docstring''' from sklearn.metrics import fa_score import datasets snake_case__ : str = ''' The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation: F1 = 2 * (precision * recall) / (precision + recall) ''' snake_case__ : int ...
274
0
'''simple docstring''' import json from typing import List, Optional, Tuple from tokenizers import pre_tokenizers, processors from ...tokenization_utils_base import AddedToken, BatchEncoding from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_bart import Ba...
350
'''simple docstring''' import os from glob import glob import imageio import torch import torchvision import wandb from img_processing import custom_to_pil, loop_post_process, preprocess, preprocess_vqgan from loaders import load_vqgan from PIL import Image from torch import nn from transformers import CLIPModel, C...
274
0
'''simple docstring''' import logging import os from typing import List, TextIO, Union from conllu import parse_incr from utils_ner import InputExample, Split, TokenClassificationTask snake_case__ : Optional[int] = logging.getLogger(__name__) class __SCREAMING_SNAKE_CASE ( lowerC...
351
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" UpperCAmelCase_ : Optional[int] = [0] * len(lowerCamelCase_ ) for i in range(1 , len(lowerCamelCase_ ) ): # use last results f...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" UpperCAmelCase_ : Dict = [1] UpperCAmelCase_ : Dict = 0, 0, 0 UpperCAmelCase_ : str = ugly_nums[ia] * 2 UpperC...
352
'''simple docstring''' import os import time import numpy as np import onnxruntime as ort snake_case__ : Optional[int] = '''1''' snake_case__ : str = '''0''' snake_case__ : List[str] = '''1''' snake_case__ : List[str] = ort.SessionOptions...
274
0
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Dict = ['''image_processor''', '''tokenizer''...
353
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return int(input_a == input_a == 0 ) def _lowerCamelCase ( ): """simple docstring""" print('Truth Table of NOR Gate:' ...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" UpperCAmelCase_ : str = len(lowerCamelCase_ ) while cur > 1: # Find the maximum number in arr UpperCAmelCase_ : ...
354
'''simple docstring''' from typing import Optional, Union import torch from torch import nn from ...configuration_utils import ConfigMixin, register_to_config from ...models.modeling_utils import ModelMixin class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , lowerCamelCase_ ): '''simp...
274
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available, is_torch_available, ) snake_case__ : Optional[int] = {'''configuration_reformer''': ['''REFORMER_PR...
355
'''simple docstring''' from manim import * class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def _UpperCamelCase ( self ): '''simple docstring''' UpperCAmelCase_ : Dict = Rectangle(height=0.5 , width=0.5 ...
274
0
'''simple docstring''' import unittest from knapsack import knapsack as k class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelCase ( self ): '''simple docstring''' UpperCAmelCase_ : int = 0 ...
356
'''simple docstring''' import math from typing import List, Optional, Tuple, Union import numpy as np import torch from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils import SchedulerMixin, SchedulerOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , ...
274
0
'''simple docstring''' from __future__ import annotations import math from collections import Counter from string import ascii_lowercase def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" UpperCAmelCase_ : int = analyze_text(lowerCamelCase...
357
'''simple docstring''' from typing import Any, Dict, List, Optional, Tuple, Union import torch from torch import nn from torch.utils.data import DistributedSampler, RandomSampler from transformers import PreTrainedModel, Trainer, logging from transformers.integrations import is_fairscale_available from transformers...
274
0
def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return base * power(lowerCamelCase_ , (exponent - 1) ) if exponent else 1 if __name__ == "__main__": print('''Raise base to the power of exponent using recursi...
358
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Tuple = ['''image_processor''', '''tokenizer'...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : Dict ): """simple docstring""" stooge(lowerCamelCase_ , 0 , len(lowerCamelCase_ ) - 1 ) return arr def _lowerCamelCase ( lowerCamelCase_ : Optional[int] , lowerCame...
359
'''simple docstring''' snake_case__ : str = '''Tobias Carryer''' from time import time class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ , snake_case_ , snake_case_=int(time() ) ): # no...
274
0
'''simple docstring''' import os import tempfile import unittest from transformers import DistilBertConfig, is_torch_available from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_modeling_common import M...
360
'''simple docstring''' import unittest from parameterized import parameterized from transformers import OpenLlamaConfig, is_torch_available, set_seed from transformers.testing_utils import require_torch, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common impor...
274
0
'''simple docstring''' import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import MgpstrTokenizer from transformers.models.mgp_str.tokenization_mgp_str import VOCAB_FILES_NAMES from transformers.testing_utils import require_torch, require_vision fro...
361
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str , lowerCamelCase_ : str = " " ): """simple docstring""" UpperCAmelCase_ : str = [] UpperCAmelCase_ : List[Any] = 0 for index, char in enumerate(lowe...
274
0
'''simple docstring''' import math from typing import List, Optional, Tuple, Union import numpy as np import torch from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils import SchedulerMixin, SchedulerOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , ...
362
'''simple docstring''' import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface...
274
0
from typing import TYPE_CHECKING from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable snake_case__ : Optional[int] = {'''configuration_gpt_neox''': ['''GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoXConfig''']}...
363
'''simple docstring''' import hashlib import unittest from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available from transformers.pipelines import DepthEstimationPipeline, pipeline from transformers.testing_utils import ( is_pipeline_test, nested_simplify, requi...
274
0
'''simple docstring''' import itertools from dataclasses import dataclass from typing import Optional import pandas as pd import pyarrow as pa import datasets from datasets.table import table_cast @dataclass class __SCREAMING_SNAKE_CASE ( datasets.BuilderConfig ): '''simple docstring'''...
364
'''simple docstring''' import copy import os import tempfile from unittest import TestCase from unittest.mock import patch import numpy as np import pyarrow as pa import pyarrow.parquet as pq import pytest from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence from datas...
274
0
'''simple docstring''' import argparse import shlex import runhouse as rh if __name__ == "__main__": # Refer to https://runhouse-docs.readthedocs-hosted.com/en/latest/api/python/cluster.html#hardware-setup for cloud access # setup instructions, if using on-demand hardware # If user passes --user <user> --host ...
365
'''simple docstring''' snake_case__ : Optional[Any] = tuple[float, float, float] snake_case__ : Tuple = tuple[float, float, float] def _lowerCamelCase ( lowerCamelCase_ : Pointad , lowerCamelCase_ : Pointad ): """simple docstring""" ...
274
0
'''simple docstring''' snake_case__ : Optional[Any] = tuple[float, float, float] snake_case__ : Tuple = tuple[float, float, float] def _lowerCamelCase ( lowerCamelCase_ : Pointad , lowerCamelCase_ : Pointad ): """simple docstring""" ...
366
'''simple docstring''' from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig snake_case__ : Dict = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''...
274
0
'''simple docstring''' from collections import deque class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ , snake_case_ ): '''simple docstring''' UpperCAmelCase_ ...
367
'''simple docstring''' from __future__ import annotations from collections import deque from collections.abc import Iterator from dataclasses import dataclass @dataclass class __SCREAMING_SNAKE_CASE : '''simple docstring''' lowerCamelCase_ :int lowerCamelCase_ :int class ...
274
0
'''simple docstring''' import importlib import math import os from dataclasses import dataclass from enum import Enum from typing import Any, Dict, Optional, Tuple, Union import flax import jax.numpy as jnp from ..utils import BaseOutput snake_case__ : List[Any] = '''scheduler_config.json''' ...
368
'''simple docstring''' from typing import List, Optional from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''huggingface/autoformer-tourism-monthly''':...
274
0
'''simple docstring''' import math import unittest from transformers import BioGptConfig, is_torch_available from transformers.testing_utils import require_torch, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common import ConfigTester from ...test_modeling...
369
'''simple docstring''' import unittest from transformers.utils.backbone_utils import ( BackboneMixin, get_aligned_output_features_output_indices, verify_out_features_out_indices, ) class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelC...
274
0
'''simple docstring''' import inspect from typing import Callable, List, Optional, Union import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers import DiffusionPipeline from diffusers.models import AutoencoderKL, UNetaDConditionModel from diffusers.pipelines.stable_dif...
370
'''simple docstring''' import numpy as np import torch from torch.nn import CrossEntropyLoss from transformers import AutoModelForCausalLM, AutoTokenizer import datasets from datasets import logging snake_case__ : str = '''\ ''' snake_case__ : Union[str, Any] = ''' Perplexit...
274
0
'''simple docstring''' import argparse import evaluate import torch from datasets import load_dataset from torch.optim import AdamW from torch.utils.data import DataLoader from transformers import AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup, set_seed from accelerate import Acc...
371
'''simple docstring''' from sklearn.metrics import fa_score import datasets snake_case__ : str = ''' The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation: F1 = 2 * (precision * recall) / (precision + recall) ''' snake_case__ : int ...
274
0
'''simple docstring''' snake_case__ : List[str] = {str(digit): digit**5 for digit in range(10)} def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" return sum(DIGITS_FIFTH_POWER[digit] for digit in str(lowerCamelCase_ ) ) def _l...
350
'''simple docstring''' import os from glob import glob import imageio import torch import torchvision import wandb from img_processing import custom_to_pil, loop_post_process, preprocess, preprocess_vqgan from loaders import load_vqgan from PIL import Image from torch import nn from transformers import CLIPModel, C...
274
0
'''simple docstring''' import os from glob import glob import imageio import torch import torchvision import wandb from img_processing import custom_to_pil, loop_post_process, preprocess, preprocess_vqgan from loaders import load_vqgan from PIL import Image from torch import nn from transformers import CLIPModel, C...
351
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" UpperCAmelCase_ : Optional[int] = [0] * len(lowerCamelCase_ ) for i in range(1 , len(lowerCamelCase_ ) ): # use last results f...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : Any ): """simple docstring""" UpperCAmelCase_ : Optional[Any] = [] UpperCAmelCase_ : str = [] UpperCAmelCase_ : Union[str, Any] = { '^': ...
352
'''simple docstring''' import os import time import numpy as np import onnxruntime as ort snake_case__ : Optional[int] = '''1''' snake_case__ : str = '''0''' snake_case__ : List[str] = '''1''' snake_case__ : List[str] = ort.SessionOptions...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" if not isinstance(lowerCamelCase_ , lowerCamelCase_ ): UpperCAmelCase_ : Union[str, Any] = F'''Input value of [number={number}] must be an integ...
353
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return int(input_a == input_a == 0 ) def _lowerCamelCase ( ): """simple docstring""" print('Truth Table of NOR Gate:' ...
274
0
'''simple docstring''' from typing import Dict import numpy as np import torch from . import residue_constants as rc from .tensor_utils import tensor_tree_map, tree_map def _lowerCamelCase ( lowerCamelCase_ : Dict[str, torch.Tensor] ): """simple docstring""" ...
354
'''simple docstring''' from typing import Optional, Union import torch from torch import nn from ...configuration_utils import ConfigMixin, register_to_config from ...models.modeling_utils import ModelMixin class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , lowerCamelCase_ ): '''simp...
274
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_mobilebert import MobileBertTokenizer snake_case__ : Optional[int] = logg...
355
'''simple docstring''' from manim import * class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def _UpperCamelCase ( self ): '''simple docstring''' UpperCAmelCase_ : Dict = Rectangle(height=0.5 , width=0.5 ...
274
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[str] = logging.get_logger(__name__) snake_case__ : Optional[int] = { '''tiiuae/falcon-40b''': '''https://huggingface.co/tiiuae/falcon-40b/resolve/mai...
356
'''simple docstring''' import math from typing import List, Optional, Tuple, Union import numpy as np import torch from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils import SchedulerMixin, SchedulerOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , ...
274
0
'''simple docstring''' import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface...
357
'''simple docstring''' from typing import Any, Dict, List, Optional, Tuple, Union import torch from torch import nn from torch.utils.data import DistributedSampler, RandomSampler from transformers import PreTrainedModel, Trainer, logging from transformers.integrations import is_fairscale_available from transformers...
274
0
from math import ceil def _lowerCamelCase ( lowerCamelCase_ : List[str] , lowerCamelCase_ : Tuple ): """simple docstring""" UpperCAmelCase_ : Optional[int] = list(range(0 , lowerCamelCase_ ) ) UpperCAmelCase_ : ...
358
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Tuple = ['''image_processor''', '''tokenizer'...
274
0
'''simple docstring''' import os import tempfile from functools import partial from unittest import TestCase from unittest.mock import patch import datasets import datasets.config from .utils import require_beam class __SCREAMING_SNAKE_CASE ( datasets.BeamBasedBuilder ): '''simple docstring...
359
'''simple docstring''' snake_case__ : str = '''Tobias Carryer''' from time import time class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ , snake_case_ , snake_case_=int(time() ) ): # no...
274
0
'''simple docstring''' from collections import OrderedDict from typing import Any, Mapping, Optional from ... import PreTrainedTokenizer, TensorType, is_torch_available from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfigWithPast from ...utils import logging snake_case__ : ...
360
'''simple docstring''' import unittest from parameterized import parameterized from transformers import OpenLlamaConfig, is_torch_available, set_seed from transformers.testing_utils import require_torch, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common impor...
274
0
'''simple docstring''' from multiprocessing import Lock, Pipe, Process # lock used to ensure that two processes do not access a pipe at the same time snake_case__ : str = Lock() def _lowerCamelCase ( lowerCamelCase_ : List[Any] , lowerCamelCase_ : Union[str, Any] , ...
361
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str , lowerCamelCase_ : str = " " ): """simple docstring""" UpperCAmelCase_ : str = [] UpperCAmelCase_ : List[Any] = 0 for index, char in enumerate(lowe...
274
0
'''simple docstring''' import torch from diffusers import EulerDiscreteScheduler from diffusers.utils import torch_device from .test_schedulers import SchedulerCommonTest class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Union[str, Any] ...
362
'''simple docstring''' import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface...
274
0
from __future__ import annotations from PIL import Image # Define glider example snake_case__ : str = [ [0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0...
363
'''simple docstring''' import hashlib import unittest from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available from transformers.pipelines import DepthEstimationPipeline, pipeline from transformers.testing_utils import ( is_pipeline_test, nested_simplify, requi...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : list[list[int]] , lowerCamelCase_ : int , lowerCamelCase_ : int , lowerCamelCase_ : set ): """simple docstring""" UpperCAmelCase_ : Union[str, Any] = le...
364
'''simple docstring''' import copy import os import tempfile from unittest import TestCase from unittest.mock import patch import numpy as np import pyarrow as pa import pyarrow.parquet as pq import pytest from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence from datas...
274
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) snake_case__ : Dict = { '''configuration_swiftformer''': [ '''SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SwiftFo...
365
'''simple docstring''' snake_case__ : Optional[Any] = tuple[float, float, float] snake_case__ : Tuple = tuple[float, float, float] def _lowerCamelCase ( lowerCamelCase_ : Pointad , lowerCamelCase_ : Pointad ): """simple docstring""" ...
274
0
'''simple docstring''' import logging import os import threading import time try: import warnings except ImportError: snake_case__ : List[str] = None try: import msvcrt except ImportError: snake_case__ : Optional[Any] = None try: import fcntl except ImportError: s...
366
'''simple docstring''' from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig snake_case__ : Dict = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''...
274
0
'''simple docstring''' import importlib import os from dataclasses import dataclass from enum import Enum from typing import Any, Dict, Optional, Union import torch from ..utils import BaseOutput snake_case__ : str = '''scheduler_config.json''' class __SCREAMING_...
367
'''simple docstring''' from __future__ import annotations from collections import deque from collections.abc import Iterator from dataclasses import dataclass @dataclass class __SCREAMING_SNAKE_CASE : '''simple docstring''' lowerCamelCase_ :int lowerCamelCase_ :int class ...
274
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : int = { '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santac...
368
'''simple docstring''' from typing import List, Optional from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''huggingface/autoformer-tourism-monthly''':...
274
0
'''simple docstring''' import numpy as np class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self ): '''simple docstring''' UpperCAmelCase_ : Tuple = (0, 0) UpperCAmelCase_ : List[str] = None ...
369
'''simple docstring''' import unittest from transformers.utils.backbone_utils import ( BackboneMixin, get_aligned_output_features_output_indices, verify_out_features_out_indices, ) class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelC...
274
0
'''simple docstring''' from math import pi def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return 2 * pi * radius * (angle / 360) if __name__ == "__main__": print(arc_length(90, 10))
370
'''simple docstring''' import numpy as np import torch from torch.nn import CrossEntropyLoss from transformers import AutoModelForCausalLM, AutoTokenizer import datasets from datasets import logging snake_case__ : str = '''\ ''' snake_case__ : Union[str, Any] = ''' Perplexit...
274
0
'''simple docstring''' from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :int = '''ClapFeatureExtractor''' lowerCamelCase_ :Tuple ...
371
'''simple docstring''' from sklearn.metrics import fa_score import datasets snake_case__ : str = ''' The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation: F1 = 2 * (precision * recall) / (precision + recall) ''' snake_case__ : int ...
274
0
'''simple docstring''' from __future__ import annotations import unittest from transformers import DebertaVaConfig, is_tf_available from transformers.testing_utils import require_tf, slow from ...test_configuration_common import ConfigTester from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, ra...
350
'''simple docstring''' import os from glob import glob import imageio import torch import torchvision import wandb from img_processing import custom_to_pil, loop_post_process, preprocess, preprocess_vqgan from loaders import load_vqgan from PIL import Image from torch import nn from transformers import CLIPModel, C...
274
0
'''simple docstring''' import argparse import json import logging import os import sys from unittest.mock import patch from transformers.testing_utils import TestCasePlus, get_gpu_count, slow snake_case__ : Optional[Any] = [ os.path.join(os.path.dirname(__file__), dirname) for dirname in...
351
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" UpperCAmelCase_ : Optional[int] = [0] * len(lowerCamelCase_ ) for i in range(1 , len(lowerCamelCase_ ) ): # use last results f...
274
0
'''simple docstring''' from typing import Union import fire import torch from tqdm import tqdm def _lowerCamelCase ( lowerCamelCase_ : str , lowerCamelCase_ : str = "cpu" , lowerCamelCase_ : Union[str, None] = None ): """simple docstring""" UpperCAmel...
352
'''simple docstring''' import os import time import numpy as np import onnxruntime as ort snake_case__ : Optional[int] = '''1''' snake_case__ : str = '''0''' snake_case__ : List[str] = '''1''' snake_case__ : List[str] = ort.SessionOptions...
274
0
'''simple docstring''' import os import time import numpy as np import onnxruntime as ort snake_case__ : Optional[int] = '''1''' snake_case__ : str = '''0''' snake_case__ : List[str] = '''1''' snake_case__ : List[str] = ort.SessionOpt...
353
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return int(input_a == input_a == 0 ) def _lowerCamelCase ( ): """simple docstring""" print('Truth Table of NOR Gate:' ...
274
0
'''simple docstring''' import tempfile import torch from diffusers import ( DEISMultistepScheduler, DPMSolverMultistepScheduler, DPMSolverSinglestepScheduler, UniPCMultistepScheduler, ) from .test_schedulers import SchedulerCommonTest class __SCREAMING_SNAKE_CASE ...
354
'''simple docstring''' from typing import Optional, Union import torch from torch import nn from ...configuration_utils import ConfigMixin, register_to_config from ...models.modeling_utils import ModelMixin class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , lowerCamelCase_ ): '''simp...
274
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_...
355
'''simple docstring''' from manim import * class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def _UpperCamelCase ( self ): '''simple docstring''' UpperCAmelCase_ : Dict = Rectangle(height=0.5 , width=0.5 ...
274
0
'''simple docstring''' import inspect import math import tempfile import unittest import numpy as np from transformers import ViTMAEConfig from transformers.testing_utils import require_torch, require_vision, slow, torch_device from transformers.utils import cached_property, is_torch_available, is_vision_available ...
356
'''simple docstring''' import math from typing import List, Optional, Tuple, Union import numpy as np import torch from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils import SchedulerMixin, SchedulerOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , ...
274
0
'''simple docstring''' from typing import Optional, Tuple, Union import torch from diffusers import DiffusionPipeline, ImagePipelineOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def __init__( self , snake_case_ , snake_case_ ): ...
357
'''simple docstring''' from typing import Any, Dict, List, Optional, Tuple, Union import torch from torch import nn from torch.utils.data import DistributedSampler, RandomSampler from transformers import PreTrainedModel, Trainer, logging from transformers.integrations import is_fairscale_available from transformers...
274
0
from __future__ import annotations from collections import deque from collections.abc import Iterator from dataclasses import dataclass @dataclass class __SCREAMING_SNAKE_CASE : '''simple docstring''' lowerCamelCase_ :int lowerCamelCase_ :int class __SCREAMING_SNAKE_CAS...
358
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Tuple = ['''image_processor''', '''tokenizer'...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" UpperCAmelCase_ : Union[str, Any] = (1 + 24 * n) ** 0.5 return ((1 + root) / 6) % 1 == 0 def _lowerCamelCase ( lowerCamelCase_ : int = 5000 ): ...
359
'''simple docstring''' snake_case__ : str = '''Tobias Carryer''' from time import time class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ , snake_case_ , snake_case_=int(time() ) ): # no...
274
0
'''simple docstring''' import json import logging import math import os import sys from dataclasses import dataclass, field from typing import Optional from datasets import Dataset, load_dataset import transformers from transformers import ( CONFIG_MAPPING, MODEL_FOR_MASKED_LM_MAPPING, AutoConfig,...
360
'''simple docstring''' import unittest from parameterized import parameterized from transformers import OpenLlamaConfig, is_torch_available, set_seed from transformers.testing_utils import require_torch, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common impor...
274
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available snake_case__ : str = { '''configuration_table_transformer''': [ '''TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''TableTransfor...
361
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str , lowerCamelCase_ : str = " " ): """simple docstring""" UpperCAmelCase_ : str = [] UpperCAmelCase_ : List[Any] = 0 for index, char in enumerate(lowe...
274
0
'''simple docstring''' import math import tensorflow as tf from packaging import version def _lowerCamelCase ( lowerCamelCase_ : int ): """simple docstring""" UpperCAmelCase_ : str = tf.convert_to_tensor(lowerCamelCase_ ) UpperCAmelCase_ : ...
362
'''simple docstring''' import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface...
274
0
from itertools import permutations def _lowerCamelCase ( lowerCamelCase_ : tuple ): """simple docstring""" if num[3] % 2 != 0: return False if (num[2] + num[3] + num[4]) % 3 != 0: return False if num[5] % 5 != 0: return False UpperCAm...
363
'''simple docstring''' import hashlib import unittest from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available from transformers.pipelines import DepthEstimationPipeline, pipeline from transformers.testing_utils import ( is_pipeline_test, nested_simplify, requi...
274
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : int = logging.get_logger(__name__) snake_case__ : List[Any] = { '''google/canine-s''': '''https://huggingface.co/google/canine-s/resolve/main/config.j...
364
'''simple docstring''' import copy import os import tempfile from unittest import TestCase from unittest.mock import patch import numpy as np import pyarrow as pa import pyarrow.parquet as pq import pytest from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence from datas...
274
0
'''simple docstring''' from __future__ import annotations from collections.abc import Iterable, Iterator from dataclasses import dataclass snake_case__ : str = (3, 9, -11, 0, 7, 5, 1, -1) snake_case__ : Any = (4, 6, 2, 0, 8, 10, 3, -2) @dataclass class __SCREAMING_SN...
365
'''simple docstring''' snake_case__ : Optional[Any] = tuple[float, float, float] snake_case__ : Tuple = tuple[float, float, float] def _lowerCamelCase ( lowerCamelCase_ : Pointad , lowerCamelCase_ : Pointad ): """simple docstring""" ...
274
0
'''simple docstring''' import math def _lowerCamelCase ( lowerCamelCase_ : int = 100 ): """simple docstring""" UpperCAmelCase_ : Tuple = sum(i * i for i in range(1 , n + 1 ) ) UpperCAmelCase_ : Union[str, Any] = i...
366
'''simple docstring''' from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig snake_case__ : Dict = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''...
274
0
'''simple docstring''' import hashlib import unittest from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available from transformers.pipelines import DepthEstimationPipeline, pipeline from transformers.testing_utils import ( is_pipeline_test, nested_simplify,...
367
'''simple docstring''' from __future__ import annotations from collections import deque from collections.abc import Iterator from dataclasses import dataclass @dataclass class __SCREAMING_SNAKE_CASE : '''simple docstring''' lowerCamelCase_ :int lowerCamelCase_ :int class ...
274
0
'''simple docstring''' import darl # noqa import gym import tqdm from diffusers.experimental import ValueGuidedRLPipeline snake_case__ : Dict = { '''n_samples''': 64, '''horizon''': 32, '''num_inference_steps''': 20, '''n_guide_steps''': 2, # can set to 0 for faster sampling, do...
368
'''simple docstring''' from typing import List, Optional from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''huggingface/autoformer-tourism-monthly''':...
274
0
'''simple docstring''' import inspect import unittest from transformers import DecisionTransformerConfig, is_torch_available from transformers.testing_utils import require_torch, slow, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common import ConfigTester from ...
369
'''simple docstring''' import unittest from transformers.utils.backbone_utils import ( BackboneMixin, get_aligned_output_features_output_indices, verify_out_features_out_indices, ) class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelC...
274
0
'''simple docstring''' import gc import unittest import torch from parameterized import parameterized from diffusers import AutoencoderKL from diffusers.utils import floats_tensor, load_hf_numpy, require_torch_gpu, slow, torch_all_close, torch_device from diffusers.utils.import_utils import is_xformers_available fr...
370
'''simple docstring''' import numpy as np import torch from torch.nn import CrossEntropyLoss from transformers import AutoModelForCausalLM, AutoTokenizer import datasets from datasets import logging snake_case__ : str = '''\ ''' snake_case__ : Union[str, Any] = ''' Perplexit...
274
0
'''simple docstring''' from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : Optional[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''microsoft/cvt-13''': '''https://huggingface.co/microsoft/cvt-13/resolve/m...
371
'''simple docstring''' from sklearn.metrics import fa_score import datasets snake_case__ : str = ''' The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation: F1 = 2 * (precision * recall) / (precision + recall) ''' snake_case__ : int ...
274
0
'''simple docstring''' import warnings from ...utils import logging from .image_processing_flava import FlavaImageProcessor snake_case__ : Optional[int] = logging.get_logger(__name__) class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def __...
350
'''simple docstring''' import os from glob import glob import imageio import torch import torchvision import wandb from img_processing import custom_to_pil, loop_post_process, preprocess, preprocess_vqgan from loaders import load_vqgan from PIL import Image from torch import nn from transformers import CLIPModel, C...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int = 1000000 ): UpperCAmelCase_ : int = limit + 1 UpperCAmelCase_ : str = [0] * limit for first_term in range(1 , lowerCamelCase_ ): for n in range(lowerCa...
351
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" UpperCAmelCase_ : Optional[int] = [0] * len(lowerCamelCase_ ) for i in range(1 , len(lowerCamelCase_ ) ): # use last results f...
274
0
'''simple docstring''' import warnings from ...utils import logging from .image_processing_segformer import SegformerImageProcessor snake_case__ : Optional[int] = logging.get_logger(__name__) class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' ...
352
'''simple docstring''' import os import time import numpy as np import onnxruntime as ort snake_case__ : Optional[int] = '''1''' snake_case__ : str = '''0''' snake_case__ : List[str] = '''1''' snake_case__ : List[str] = ort.SessionOptions...
274
0
'''simple docstring''' import math from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : str = logging.get_logger(__name__) snake_case__ : List[str] = { '''facebook/data2vec-base-960h''': '''https://huggingface.co/facebook/data2...
353
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int ): """simple docstring""" return int(input_a == input_a == 0 ) def _lowerCamelCase ( ): """simple docstring""" print('Truth Table of NOR Gate:' ...
274
0
'''simple docstring''' import math_equivalence # From: git+https://github.com/hendrycks/math.git import datasets snake_case__ : str = '''\ @article{hendrycksmath2021, title={Measuring Mathematical Problem Solving With the MATH Dataset}, author={Dan Hendrycks and Collin Burns ...
354
'''simple docstring''' from typing import Optional, Union import torch from torch import nn from ...configuration_utils import ConfigMixin, register_to_config from ...models.modeling_utils import ModelMixin class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , lowerCamelCase_ ): '''simp...
274
0
'''simple docstring''' from typing import List, Optional, Tuple, Union import torch from torch import nn from torch.nn import CrossEntropyLoss from ... import AutoBackbone from ...modeling_outputs import SemanticSegmenterOutput from ...modeling_utils import PreTrainedModel from ...utils import add_start_docstrings,...
355
'''simple docstring''' from manim import * class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' def _UpperCamelCase ( self ): '''simple docstring''' UpperCAmelCase_ : Dict = Rectangle(height=0.5 , width=0.5 ...
274
0
'''simple docstring''' import math import os import re import sys import unittest from pathlib import Path from typing import Tuple from unittest.mock import patch from parameterized import parameterized from transformers.testing_utils import ( CaptureStderr, ExtendSysPath, TestCasePlus, execute_sub...
356
'''simple docstring''' import math from typing import List, Optional, Tuple, Union import numpy as np import torch from ..configuration_utils import ConfigMixin, register_to_config from .scheduling_utils import SchedulerMixin, SchedulerOutput class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ , ...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str ): """simple docstring""" if n_term == "": return [] UpperCAmelCase_ : list = [] for temp in range(int(lowerCamelCase_ ) ): series.append(F'''1/{temp + ...
357
'''simple docstring''' from typing import Any, Dict, List, Optional, Tuple, Union import torch from torch import nn from torch.utils.data import DistributedSampler, RandomSampler from transformers import PreTrainedModel, Trainer, logging from transformers.integrations import is_fairscale_available from transformers...
274
0
import os from pickle import UnpicklingError from typing import Dict, Tuple import jax import jax.numpy as jnp import numpy as np from flax.serialization import from_bytes from flax.traverse_util import flatten_dict, unflatten_dict import transformers from .utils import logging snake_case__ : Optional[int...
358
'''simple docstring''' import warnings from ...processing_utils import ProcessorMixin from ...tokenization_utils_base import BatchEncoding class __SCREAMING_SNAKE_CASE ( lowerCamelCase_ ): '''simple docstring''' lowerCamelCase_ :Tuple = ['''image_processor''', '''tokenizer'...
274
0
'''simple docstring''' import gc import unittest from parameterized import parameterized from diffusers import FlaxUNetaDConditionModel from diffusers.utils import is_flax_available from diffusers.utils.testing_utils import load_hf_numpy, require_flax, slow if is_flax_available(): import jax import jax.numpy as...
359
'''simple docstring''' snake_case__ : str = '''Tobias Carryer''' from time import time class __SCREAMING_SNAKE_CASE : '''simple docstring''' def __init__( self , snake_case_ , snake_case_ , snake_case_ , snake_case_=int(time() ) ): # no...
274
0
'''simple docstring''' 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_...
360
'''simple docstring''' import unittest from parameterized import parameterized from transformers import OpenLlamaConfig, is_torch_available, set_seed from transformers.testing_utils import require_torch, torch_device from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common impor...
274
0
'''simple docstring''' import importlib.util import os import platform from argparse import ArgumentParser import huggingface_hub from .. import __version__ as version from ..utils import ( is_accelerate_available, is_flax_available, is_safetensors_available, is_tf_available, is_torch_available,...
361
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : str , lowerCamelCase_ : str = " " ): """simple docstring""" UpperCAmelCase_ : str = [] UpperCAmelCase_ : List[Any] = 0 for index, char in enumerate(lowe...
274
0
'''simple docstring''' def _lowerCamelCase ( lowerCamelCase_ : int = 1000 ): """simple docstring""" return sum(e for e in range(3 , lowerCamelCase_ ) if e % 3 == 0 or e % 5 == 0 ) if __name__ == "__main__": print(f'''{solution() = }''')
362
'''simple docstring''' import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface...
274
0
import inspect from typing import Optional, Union import numpy as np import PIL import torch from torch.nn import functional as F from torchvision import transforms from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, ...
363
'''simple docstring''' import hashlib import unittest from transformers import MODEL_FOR_DEPTH_ESTIMATION_MAPPING, is_torch_available, is_vision_available from transformers.pipelines import DepthEstimationPipeline, pipeline from transformers.testing_utils import ( is_pipeline_test, nested_simplify, requi...
274
0
'''simple docstring''' import argparse import os import re import zipfile import torch from transformers import AutoTokenizer, GPTaConfig def _lowerCamelCase ( lowerCamelCase_ : Union[str, Any] , lowerCamelCase_ : Optional[int] , lowerCamelCase_ : Optional[int]=0 ...
364
'''simple docstring''' import copy import os import tempfile from unittest import TestCase from unittest.mock import patch import numpy as np import pyarrow as pa import pyarrow.parquet as pq import pytest from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence from datas...
274
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available snake_case__ : str = {'''configuration_glpn''': ['''GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GLPNConfig''']} try: if not is_vision_...
365
'''simple docstring''' snake_case__ : Optional[Any] = tuple[float, float, float] snake_case__ : Tuple = tuple[float, float, float] def _lowerCamelCase ( lowerCamelCase_ : Pointad , lowerCamelCase_ : Pointad ): """simple docstring""" ...
274
0
'''simple docstring''' import argparse import os import evaluate import torch from datasets import load_dataset from torch.optim import AdamW from torch.utils.data import DataLoader from transformers import AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup, set_seed from accelerate ...
366
'''simple docstring''' from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig snake_case__ : Dict = { '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''', '''...
274
0
'''simple docstring''' import gc import unittest import numpy as np import torch from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, StableDiffusionSAGPipeline, UNetaDConditionModel, ) from diffusers.utils import...
367
'''simple docstring''' from __future__ import annotations from collections import deque from collections.abc import Iterator from dataclasses import dataclass @dataclass class __SCREAMING_SNAKE_CASE : '''simple docstring''' lowerCamelCase_ :int lowerCamelCase_ :int class ...
274
0
'''simple docstring''' from __future__ import annotations import math def _lowerCamelCase ( lowerCamelCase_ : int , lowerCamelCase_ : int , lowerCamelCase_ : bool , lowerCamelCase_ : list[int] , lowerCamelCase_ : float ): """simple d...
368
'''simple docstring''' from typing import List, Optional from ...configuration_utils import PretrainedConfig from ...utils import logging snake_case__ : List[Any] = logging.get_logger(__name__) snake_case__ : Optional[Any] = { '''huggingface/autoformer-tourism-monthly''':...
274
0
'''simple docstring''' import contextlib import faulthandler import io import multiprocessing import os import platform import signal import tempfile def _lowerCamelCase ( lowerCamelCase_ : Union[str, Any] , lowerCamelCase_ : List[str] , lowerCamelCase_ : List[str] , ...
369
'''simple docstring''' import unittest from transformers.utils.backbone_utils import ( BackboneMixin, get_aligned_output_features_output_indices, verify_out_features_out_indices, ) class __SCREAMING_SNAKE_CASE ( unittest.TestCase ): '''simple docstring''' def _UpperCamelC...
274
0
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available snake_case__ : int = { '''configuration_biogpt''': ['''BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''BioGptConfig'''], '''to...
370
'''simple docstring''' import numpy as np import torch from torch.nn import CrossEntropyLoss from transformers import AutoModelForCausalLM, AutoTokenizer import datasets from datasets import logging snake_case__ : str = '''\ ''' snake_case__ : Union[str, Any] = ''' Perplexit...
274
0
'''simple docstring''' from __future__ import annotations import numpy as np def _lowerCamelCase ( lowerCamelCase_ : np.ndarray ): """simple docstring""" UpperCAmelCase_ : str = np.shape(lowerCamelCase_ ) if rows != columns: UpperCAmelCa...
371
'''simple docstring''' from sklearn.metrics import fa_score import datasets snake_case__ : str = ''' The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation: F1 = 2 * (precision * recall) / (precision + recall) ''' snake_case__ : int ...
274
0
'''simple docstring''' from collections import OrderedDict from typing import Mapping from packaging import version from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging from ..auto import CONFIG_MAPPING lowerCAmelCase :List[str] = logging...
275
'''simple docstring''' # tests directory-specific settings - this file is run automatically # by pytest before any tests are run import doctest import sys import warnings from os.path import abspath, dirname, join import _pytest from transformers.testing_utils import HfDoctestModule, HfDocTestParser # allow ha...
275
1
'''simple docstring''' lowerCAmelCase :Any = ''' # Installazione di Transformers ! pip install transformers datasets # Per installare dalla fonte invece dell\'ultima versione rilasciata, commenta il comando sopra e # rimuovi la modalità commento al comando seguente. # ! pip install git+https://github...
275
'''simple docstring''' def lowerCamelCase ( lowerCAmelCase : int ): """simple docstring""" __magic_name__ : Optional[int] = 1 for i in range(1 , num + 1 ): fact *= i return fact def lowerCamelCase ( lowerCAmelCase : int ): """simple ...
275
1
'''simple docstring''' from math import factorial class _lowerCamelCase : '''simple docstring''' def __init__( self : Tuple , _A : List[str] , _A : int ) -> Union[str, Any]: __magic_name__ : Union[str, Any] = real if isinstance(_A , _A ...
275
'''simple docstring''' from typing import List, Optional, Union import torch from transformers import ( XLMRobertaTokenizer, ) from ...models import UNetaDConditionModel, VQModel from ...pipelines import DiffusionPipeline from ...pipelines.pipeline_utils import ImagePipelineOutput from ...schedulers import DD...
275
1
'''simple docstring''' import os from shutil import copyfile from typing import List, Optional, Tuple from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import is_sentencepiece_available, logging if is_sentencepiece_available(): from .tokenization_pegasus import PegasusTokenizer ...
275
'''simple docstring''' import argparse import json import os import fairseq import torch from fairseq.data import Dictionary from transformers import ( WavaVecaConfig, WavaVecaCTCTokenizer, WavaVecaFeatureExtractor, WavaVecaForCTC, WavaVecaForPreTraining, WavaVecaProcessor, logging, ) ...
275
1
'''simple docstring''' def lowerCamelCase ( lowerCAmelCase : Optional[int] , lowerCAmelCase : str ): """simple docstring""" return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2 def lowerCamelCase ( lowerCAmelCase : List[str] , lowerCAmel...
275
'''simple docstring''' import warnings from ...utils import logging from .image_processing_beit import BeitImageProcessor lowerCAmelCase :Tuple = logging.get_logger(__name__) class _lowerCamelCase ( lowercase__ ): '''simple docstring''' def __init__( self : Any , ...
275
1
'''simple docstring''' import collections import json import math import os import re import time from fnmatch import fnmatch from typing import Dict import requests from slack_sdk import WebClient lowerCAmelCase :int = WebClient(token=os.environ['''CI_SLACK_BOT_TOKEN''']) def lowerCamelCase ...
275
'''simple docstring''' from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_torch_available, ) lowerCAmelCase :str = { '''configuration_vision_encoder_decoder''': ['''VisionEncoderDecoder...
275
1
'''simple docstring''' from __future__ import annotations import unittest from transformers import AutoTokenizer, PegasusConfig, is_tf_available from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow from transformers.utils import cached_property from ...test_configura...
275
'''simple docstring''' lowerCAmelCase :Union[str, Any] = ''' # Transformers installation ! pip install transformers datasets # To install from source instead of the last release, comment the command above and uncomment the following one. # ! pip install git+https://github.com/huggingface/transformers...
275
1
'''simple docstring''' import html from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin from ...utils import is_bsa_available, logging, requires_backends if is_bsa_available(): import bsa from bsa import BeautifulSoup lowerCAmelCase :int = logging.get_logger...
275
'''simple docstring''' def lowerCamelCase ( lowerCAmelCase : str , lowerCAmelCase : Any , lowerCAmelCase : Any=False ): """simple docstring""" if isinstance(lowerCAmelCase , lowerCAmelCase ) and isinstance(lowerCAmelCase , lowerCAmelCase ): __magic_name__ : ...
275
1