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
import fire from utils import calculate_rouge, save_json def snake_case_ ( snake_case , snake_case , snake_case=None , **snake_case ) -> Optional[int]: lowercase__: str = [x.strip() for x in open(snake_case ).readlines()] ...
364
import warnings from typing import Any, Dict, List, Optional, Union import numpy as np from ...audio_utils import mel_filter_bank, optimal_fft_length, spectrogram, window_function from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...feature_extraction_utils import BatchFeatur...
288
0
import json from typing import List, Optional, Tuple from tokenizers import normalizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging from .tokenization_bert import BertTokenizer __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase...
365
import argparse import os import jax as jnp import numpy as onp import torch import torch.nn as nn from music_spectrogram_diffusion import inference from tax import checkpoints from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline from diffusers.pipelines.spectrogram_dif...
288
0
import gc import tempfile import unittest import numpy as np import torch from diffusers import VersatileDiffusionTextToImagePipeline from diffusers.utils.testing_utils import nightly, require_torch_gpu, torch_device __lowerCAmelCase = False class __a ( unittest.TestCase...
366
from collections import deque from math import floor from random import random from time import time class __a : def __init__( self ) -> Dict: '''simple docstring''' lowercase__: Dict = {} def SCREAMING_SNAKE_CASE__ ( s...
288
0
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[str]: if nth_term == "": return [""] lowercase__: Tuple = int(snake_case ) lowercase__: int = int(snak...
367
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class __a ( tf.keras.layers.Layer ): def __init__( self , ...
288
0
import argparse import os import re import packaging.version __lowerCAmelCase = '''examples/''' __lowerCAmelCase = { '''examples''': (re.compile(r'''^check_min_version\("[^"]+"\)\s*$''', re.MULTILINE), '''check_min_version("VERSION")\n'''), '''init''': (re.compile(r'''^__versi...
368
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 __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = '...
288
0
import argparse import csv import logging import os import random import numpy as np import torch from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from tqdm import tqdm, trange from transformers import ( CONFIG_NAME, WEIGHTS_NAME, AdamW, Ope...
369
import math import numpy as np import qiskit from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute def snake_case_ ( snake_case = 3 ) -> qiskit.result.counts.Counts: if isinstance(snake_case , snake_case ): raise...
288
0
import inspect import unittest import numpy as np from transformers import ViTConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_configuration_common import ConfigTester from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor if i...
370
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[str]: if nth_term == "": return [""] lowercase__: Tuple = int(snake_case ) lowercase__: int = int(snake_ca...
288
0
import logging from pathlib import Path import numpy as np import pytorch_lightning as pl import torch from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint from pytorch_lightning.utilities import rank_zero_only from utils_rag import save_json def snake_case_ ( snake...
371
from typing import Dict from transformers import EvalPrediction, HfArgumentParser, TrainingArguments, is_torch_available from transformers.testing_utils import ( TestCasePlus, execute_subprocess_async, get_torch_dist_unique_port, require_torch_multi_gpu, require_torch_neuroncore, ) ...
288
0
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> int: # Checks if the entire collection has been sorted if len(snake_case ) <= 1 or n <= 1: return insert_next(snake_case , n - 1 ) ...
350
from __future__ import annotations from numpy import array, cos, cross, floataa, radians, sin from numpy.typing import NDArray def snake_case_ ( snake_case , snake_case , snake_case = False ) -> list[float]: if radian_mode: return [magn...
288
0
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
351
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 GenerationTesterMixin from ...
288
0
from math import sqrt import numpy as np from sympy import symbols # Coefficient # Speed of light (m/s) __lowerCAmelCase = 2_99_79_24_58 # Symbols __lowerCAmelCase ,__lowerCAmelCase ,__lowerCAmelCase ,__lowerCAmelCase = symbols('''ct x y z''') def snake_case_ ( sn...
352
import argparse import os import re import tensorflow as tf import torch from transformers import BertConfig, BertModel from transformers.utils import logging logging.set_verbosity_info() __lowerCAmelCase = logging.get_logger(__name__) def snake_case_ ( snake_case ...
288
0
from sklearn.metrics import matthews_corrcoef import datasets __lowerCAmelCase = ''' Compute the Matthews correlation coefficient (MCC) The Matthews correlation coefficient is used in machine learning as a measure of the quality of binary and multiclass classifications. It takes into account true...
353
from ...configuration_utils import PretrainedConfig from ...utils import logging __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = { '''google/pegasus-large''': '''https://huggingface.co/google/pegasus-large/resolve/main/config.json''', # See all PEGASUS models ...
288
0
from __future__ import annotations import inspect import unittest import numpy as np from transformers import DeiTConfig from transformers.testing_utils import require_tf, require_vision, slow from transformers.utils import cached_property, is_tf_available, is_vision_available from ...test_configur...
354
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[int]: lowercase__: Tuple = 0 lowercase__: str = len(snake_case ) - 1 while i < j: if nums[i] + nums[j] =...
288
0
import unittest from transformers import PegasusTokenizer, PegasusTokenizerFast from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, require_torch, slow from transformers.utils import cached_property from ...test_tokenization_common import TokenizerTesterMixin ...
355
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_image_inpu...
288
0
import heapq import sys import numpy as np __lowerCAmelCase = tuple[int, int] class __a : def __init__( self ) -> Optional[int]: '''simple docstring''' lowercase__: str = [] lowercase__: List[Any] = set() def SCREA...
356
import argparse import csv import logging import os import random import numpy as np import torch from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from tqdm import tqdm, trange from transformers import ( CONFIG_NAME, WEIGHTS_NAME, AdamW, Ope...
288
0
from scipy.stats import pearsonr import datasets __lowerCAmelCase = ''' Pearson correlation coefficient and p-value for testing non-correlation. The Pearson correlation coefficient measures the linear relationship between two datasets. The calculation of the p-value relies on the assumption that e...
357
def snake_case_ ( snake_case ) -> list[int]: lowercase__: Dict = [0 for i in range(len(snake_case ) )] # initialize interval's left pointer and right pointer lowercase__ , lowercase__: Union[str, Any] = 0, 0 ...
288
0
def snake_case_ ( snake_case ) -> Dict: lowercase__: str = [] lowercase__: str = [] lowercase__: List[str] = { '^': 3, '*': 2, '/': 2, '%': 2, '+': 1, ...
358
from __future__ import annotations import inspect import unittest import numpy as np from transformers import DeiTConfig from transformers.testing_utils import require_tf, require_vision, slow from transformers.utils import cached_property, is_tf_available, is_vision_available from ...test_configur...
288
0
from math import sqrt def snake_case_ ( snake_case = 1_00_00_00 ) -> int: lowercase__: int = 0 lowercase__: int = 0 lowercase__: int while num_cuboids <= limit: max_cuboid_size += 1 ...
359
import sacrebleu as scb from packaging import version from sacrebleu import CHRF import datasets __lowerCAmelCase = '''\ @inproceedings{popovic-2015-chrf, title = "chr{F}: character n-gram {F}-score for automatic {MT} evaluation", author = "Popovi{\'c}, Maja", booktitle = "Proceeding...
288
0
from ...utils import is_note_seq_available, is_transformers_available, is_torch_available from ...utils import OptionalDependencyNotAvailable try: if not (is_transformers_available() and is_torch_available()): raise OptionalDependencyNotAvailable() except OptionalDependencyNotAvailable: from ...util...
360
from math import pow def snake_case_ ( snake_case , snake_case , snake_case , snake_case , snake_case , ) -> tuple[int, int]: if current_sum == needed_sum: # If the sum of the powers is equal to needed_sum, then...
288
0
"""simple docstring""" import json from typing import TYPE_CHECKING, List, Optional, Tuple from tokenizers import pre_tokenizers from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import logging if TYPE_CHECKING: from transformers.pipelines.conversational import C...
361
import torch from diffusers import StableDiffusionPipeline __lowerCAmelCase = '''path-to-your-trained-model''' __lowerCAmelCase = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to('''cuda''') __lowerCAmelCase = '''A photo of sks dog in a bucket''' ...
288
0
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 GenerationTesterMixin from ...
362
import json import os import unittest from transformers import CLIPTokenizer, CLIPTokenizerFast from transformers.models.clip.tokenization_clip import VOCAB_FILES_NAMES from transformers.testing_utils import require_ftfy, require_tokenizers from ...test_tokenization_common import TokenizerTesterMixin ...
288
0
from typing import Callable, Optional, Union from ...configuration_utils import PretrainedConfig from ...utils import logging __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = { '''microsoft/xprophetnet-large-wiki100-cased''': ( '''https://huggingface.co/...
363
import json import os import shutil import sys import tempfile import unittest import unittest.mock as mock from pathlib import Path from huggingface_hub import HfFolder, delete_repo from requests.exceptions import HTTPError from transformers import AutoConfig, BertConfig, GPTaConfig from transform...
288
0
import logging from transformers.configuration_utils import PretrainedConfig __lowerCAmelCase = logging.getLogger(__name__) class __a ( __UpperCamelCase ): __lowercase : Any = 'masked_bert' def __init__( self , lowerCAmelCase__=30_522 , low...
364
import warnings from typing import Any, Dict, List, Optional, Union import numpy as np from ...audio_utils import mel_filter_bank, optimal_fft_length, spectrogram, window_function from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...feature_extraction_utils import BatchFeatur...
288
0
from ...configuration_utils import PretrainedConfig from ...utils import logging __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = { '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''', } class __a ( ...
365
import argparse import os import jax as jnp import numpy as onp import torch import torch.nn as nn from music_spectrogram_diffusion import inference from tax import checkpoints from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline from diffusers.pipelines.spectrogram_dif...
288
0
from math import factorial def snake_case_ ( snake_case , snake_case ) -> int: # If either of the conditions are true, the function is being asked # to calculate a factorial of a negative number, which is not possible if n < k or k < 0: ...
366
from collections import deque from math import floor from random import random from time import time class __a : def __init__( self ) -> Dict: '''simple docstring''' lowercase__: Dict = {} def SCREAMING_SNAKE_CASE__ ( s...
288
0
from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) __lowerCAmelCase = { '''configuration_swiftformer''': [ '''SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SwiftFormerConfig''', ...
367
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class __a ( tf.keras.layers.Layer ): def __init__( self , ...
288
0
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class __a ( tf.keras.layers.Layer ): def __init__( self , ...
368
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 __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = '...
288
0
def snake_case_ ( snake_case=2_81_23 ) -> Optional[int]: lowercase__: Any = [1] * (limit + 1) for i in range(2 , int(limit**0.5 ) + 1 ): sum_divs[i * i] += i for k in range(i + 1 , limit // i + 1 ...
369
import math import numpy as np import qiskit from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute def snake_case_ ( snake_case = 3 ) -> qiskit.result.counts.Counts: if isinstance(snake_case , snake_case ): raise...
288
0
from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available, ) __lowerCAmelCase = { '''configuration_distilbert''': [ '''DISTILBERT_...
370
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[str]: if nth_term == "": return [""] lowercase__: Tuple = int(snake_case ) lowercase__: int = int(snake_ca...
288
0
import os import numpy import onnx def snake_case_ ( snake_case , snake_case ) -> int: lowercase__: Optional[Any] = a.name lowercase__: int = b.name lowercase__: Union[str, Any] = '' ...
371
from typing import Dict from transformers import EvalPrediction, HfArgumentParser, TrainingArguments, is_torch_available from transformers.testing_utils import ( TestCasePlus, execute_subprocess_async, get_torch_dist_unique_port, require_torch_multi_gpu, require_torch_neuroncore, ) ...
288
0
import unittest import torch from diffusers import VQModel from diffusers.utils import floats_tensor, torch_device from diffusers.utils.testing_utils import enable_full_determinism from .test_modeling_common import ModelTesterMixin, UNetTesterMixin enable_full_determinism() class __a ...
350
from __future__ import annotations from numpy import array, cos, cross, floataa, radians, sin from numpy.typing import NDArray def snake_case_ ( snake_case , snake_case , snake_case = False ) -> list[float]: if radian_mode: return [magn...
288
0
import argparse import pathlib import fairseq import torch from fairseq.models.roberta import RobertaModel as FairseqRobertaModel from fairseq.modules import TransformerSentenceEncoderLayer from packaging import version from transformers import XLMRobertaConfig, XLMRobertaXLForMaskedLM, XLMRobertaXLFor...
351
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 GenerationTesterMixin from ...
288
0
import logging from pathlib import Path import numpy as np import pytorch_lightning as pl import torch from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint from pytorch_lightning.utilities import rank_zero_only from utils_rag import save_json def snake_case_ ( snake...
352
import argparse import os import re import tensorflow as tf import torch from transformers import BertConfig, BertModel from transformers.utils import logging logging.set_verbosity_info() __lowerCAmelCase = logging.get_logger(__name__) def snake_case_ ( snake_case ...
288
0
from __future__ import annotations from typing import Any class __a ( __UpperCamelCase ): pass class __a : def __init__( self , lowerCAmelCase__ ) -> None: '''simple docstring''' lowercase__: Any = data ...
353
from ...configuration_utils import PretrainedConfig from ...utils import logging __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = { '''google/pegasus-large''': '''https://huggingface.co/google/pegasus-large/resolve/main/config.json''', # See all PEGASUS models ...
288
0
import itertools import random import unittest import numpy as np from transformers import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, WavaVecaConfig, WavaVecaFeatureExtractor from transformers.testing_utils import require_torch, slow from ...test_sequence_feature_extraction_common import SequenceFeatu...
354
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[int]: lowercase__: Tuple = 0 lowercase__: str = len(snake_case ) - 1 while i < j: if nums[i] + nums[j] =...
288
0
def snake_case_ ( ) -> int: return [ a * b * (10_00 - a - b) for a in range(1 , 9_99 ) for b in range(snake_case , 9_99 ) if (a * a + b * b == (10_00 - a - b) ** 2) ][0] if __name__ == "__main__": print(F'''{solutio...
355
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_image_inpu...
288
0
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_roberta import RobertaTokenizer __...
356
import argparse import csv import logging import os import random import numpy as np import torch from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from tqdm import tqdm, trange from transformers import ( CONFIG_NAME, WEIGHTS_NAME, AdamW, Ope...
288
0
import timeit import numpy as np import datasets from datasets.arrow_writer import ArrowWriter from datasets.features.features import _ArrayXD def snake_case_ ( snake_case ) -> List[str]: def wrapper(*snake_case , **snake_case ): lowercase...
357
def snake_case_ ( snake_case ) -> list[int]: lowercase__: Dict = [0 for i in range(len(snake_case ) )] # initialize interval's left pointer and right pointer lowercase__ , lowercase__: Union[str, Any] = 0, 0 ...
288
0
import inspect from typing import List, Optional, Tuple, Union import torch from ...models import UNetaDModel, VQModel from ...schedulers import DDIMScheduler from ...utils import randn_tensor from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput class __a ( __UpperCame...
358
from __future__ import annotations import inspect import unittest import numpy as np from transformers import DeiTConfig from transformers.testing_utils import require_tf, require_vision, slow from transformers.utils import cached_property, is_tf_available, is_vision_available from ...test_configur...
288
0
def snake_case_ ( snake_case = 10_00 ) -> int: return sum(e for e in range(3 , snake_case ) if e % 3 == 0 or e % 5 == 0 ) if __name__ == "__main__": print(F'''{solution() = }''')
359
import sacrebleu as scb from packaging import version from sacrebleu import CHRF import datasets __lowerCAmelCase = '''\ @inproceedings{popovic-2015-chrf, title = "chr{F}: character n-gram {F}-score for automatic {MT} evaluation", author = "Popovi{\'c}, Maja", booktitle = "Proceeding...
288
0
import argparse import json from pathlib import Path import requests import timm import torch from huggingface_hub import hf_hub_download from PIL import Image from transformers import DeiTConfig, DeiTForImageClassificationWithTeacher, DeiTImageProcessor from transformers.utils import logging lo...
360
from math import pow def snake_case_ ( snake_case , snake_case , snake_case , snake_case , snake_case , ) -> tuple[int, int]: if current_sum == needed_sum: # If the sum of the powers is equal to needed_sum, then...
288
0
"""simple docstring""" class __a : def __init__( self , lowerCAmelCase__ , lowerCAmelCase__ , lowerCAmelCase__ ) -> Tuple: '''simple docstring''' lowercase__: List[str] = name lowercase__: Any = va...
361
import torch from diffusers import StableDiffusionPipeline __lowerCAmelCase = '''path-to-your-trained-model''' __lowerCAmelCase = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to('''cuda''') __lowerCAmelCase = '''A photo of sks dog in a bucket''' ...
288
0
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 __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = '...
362
import json import os import unittest from transformers import CLIPTokenizer, CLIPTokenizerFast from transformers.models.clip.tokenization_clip import VOCAB_FILES_NAMES from transformers.testing_utils import require_ftfy, require_tokenizers from ...test_tokenization_common import TokenizerTesterMixin ...
288
0
import json import os import shutil import tempfile import unittest import numpy as np import pytest from transformers import CLIPTokenizer, CLIPTokenizerFast from transformers.models.clip.tokenization_clip import VOCAB_FILES_NAMES from transformers.testing_utils import require_vision from transform...
363
import json import os import shutil import sys import tempfile import unittest import unittest.mock as mock from pathlib import Path from huggingface_hub import HfFolder, delete_repo from requests.exceptions import HTTPError from transformers import AutoConfig, BertConfig, GPTaConfig from transform...
288
0
def snake_case_ ( snake_case , snake_case ) -> Dict: lowercase__: str = [0 for i in range(r + 1 )] # nc0 = 1 lowercase__: List[str] = 1 for i in range(1 , n + 1 ): # to compute current ...
364
import warnings from typing import Any, Dict, List, Optional, Union import numpy as np from ...audio_utils import mel_filter_bank, optimal_fft_length, spectrogram, window_function from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...feature_extraction_utils import BatchFeatur...
288
0
from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_torch_available, ) __lowerCAmelCase = { '''configuration_trocr''': ['''TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''...
365
import argparse import os import jax as jnp import numpy as onp import torch import torch.nn as nn from music_spectrogram_diffusion import inference from tax import checkpoints from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline from diffusers.pipelines.spectrogram_dif...
288
0
import math import numpy as np import qiskit from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute def snake_case_ ( snake_case = 3 ) -> qiskit.result.counts.Counts: if isinstance(snake_case , snake_case ): raise...
366
from collections import deque from math import floor from random import random from time import time class __a : def __init__( self ) -> Dict: '''simple docstring''' lowercase__: Dict = {} def SCREAMING_SNAKE_CASE__ ( s...
288
0
from typing import Optional import numpy as np import torch from torch import nn from transformers import GPTaConfig, GPTaLMHeadModel from transformers.modeling_utils import ModuleUtilsMixin from ...configuration_utils import ConfigMixin, register_to_config from ...models import ModelMixin ...
367
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from .tokenization_gpta import GPTaTokenizer class __a ( tf.keras.layers.Layer ): def __init__( self , ...
288
0
import sacrebleu as scb from packaging import version from sacrebleu import CHRF import datasets __lowerCAmelCase = '''\ @inproceedings{popovic-2015-chrf, title = "chr{F}: character n-gram {F}-score for automatic {MT} evaluation", author = "Popovi{\'c}, Maja", booktitle = "Proceeding...
368
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 __lowerCAmelCase = logging.get_logger(__name__) __lowerCAmelCase = '...
288
0
from typing import Dict from transformers import EvalPrediction, HfArgumentParser, TrainingArguments, is_torch_available from transformers.testing_utils import ( TestCasePlus, execute_subprocess_async, get_torch_dist_unique_port, require_torch_multi_gpu, require_torch_neuroncore, ) ...
369
import math import numpy as np import qiskit from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute def snake_case_ ( snake_case = 3 ) -> qiskit.result.counts.Counts: if isinstance(snake_case , snake_case ): raise...
288
0
from collections import deque class __a : def __init__( self , lowerCAmelCase__ , lowerCAmelCase__ , lowerCAmelCase__ ) -> None: '''simple docstring''' lowercase__: List[str] = process_name # process name lowercas...
370
from __future__ import annotations def snake_case_ ( snake_case , snake_case ) -> list[str]: if nth_term == "": return [""] lowercase__: Tuple = int(snake_case ) lowercase__: int = int(snake_ca...
288
0
from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tensorflow_text_available, is_torch_available __lowerCAmelCase = { '''configuration_ernie''': ['''ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ErnieConfig''', '''ErnieOnnxConfig'''], } try:...
371
from typing import Dict from transformers import EvalPrediction, HfArgumentParser, TrainingArguments, is_torch_available from transformers.testing_utils import ( TestCasePlus, execute_subprocess_async, get_torch_dist_unique_port, require_torch_multi_gpu, require_torch_neuroncore, ) ...
288
0
"""simple docstring""" from typing import Dict, List, Optional, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import center_crop, normalize, rescale, resize, to_channel_dimension_format from ...image...
289
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_torch_available, ) lowercase__ : Optional[int] = { """configuration_...
289
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available lowercase__ : Optional[int] = { """configuration_bigbird_pegasus""": [ """BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"...
289
"""simple docstring""" import logging from transformers.configuration_utils import PretrainedConfig lowercase__ : List[Any] = logging.getLogger(__name__) class UpperCamelCase__ ( lowercase_ ): """simple docstring""" ...
289
1
"""simple docstring""" from typing import Dict, List, Optional, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( center_crop, convert_to_rgb, get_resize_output_image_size, no...
289
"""simple docstring""" import random import timeit from functools import wraps from typing import Callable, Optional from ..configuration_utils import PretrainedConfig from ..models.auto.modeling_tf_auto import TF_MODEL_MAPPING, TF_MODEL_WITH_LM_HEAD_MAPPING from ..utils import is_pyanvml...
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : list , lowerCAmelCase__ : list ) -> float: """simple docstring""" _validate_point(lowerCAmelCase__ ) _validate_point(lowerCAmelCase__ ) if len(lowerCAmelCase...
289
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : List[Any] = logging.get_logger(__name__) lowercase__ : List[str] = { """s-JoL/Open-Llama-V1""": """https://huggingface.co/s-JoL/Open-Llam...
289
1
"""simple docstring""" from __future__ import annotations from fractions import Fraction from math import gcd, sqrt def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> bool: """simple docstring""" lowerCAmelCase_ : int = int(num...
289
"""simple docstring""" from typing import Dict, List, Optional, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( center_crop, get_resize_output_image_size, normalize, rescale...
289
1
"""simple docstring""" import os import unittest from transformers import LayoutLMTokenizer, LayoutLMTokenizerFast from transformers.models.layoutlm.tokenization_layoutlm import VOCAB_FILES_NAMES from transformers.testing_utils import require_tokenizers from ...test_tokenization_common i...
289
"""simple docstring""" import baseaa def UpperCamelCase_ ( lowerCAmelCase__ : str ) -> bytes: """simple docstring""" return baseaa.aaaencode(string.encode('utf-8' ) ) def UpperCamelCase_ ( lowerCAmelCase__ : bytes ) ...
289
1
"""simple docstring""" from ..utils import DummyObject, requires_backends class UpperCamelCase__ ( metaclass=lowercase_ ): """simple docstring""" _SCREAMING_SNAKE_CASE = ["""torch""", """torchsde"""] def __init__( ...
289
"""simple docstring""" import os import tempfile import unittest from transformers import FlaubertConfig, is_torch_available from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_mod...
289
1
"""simple docstring""" import unittest from transformers import AlbertConfig, is_torch_available from transformers.models.auto import get_values from transformers.testing_utils import require_torch, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_mod...
289
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices lowercase__ : Optional[int] = logging.get_logger(__name__) ...
289
1
"""simple docstring""" lowercase__ : Tuple = """ # 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/transf...
289
"""simple docstring""" from abc import ABC, abstractmethod from typing import List, Optional class UpperCamelCase__ ( lowercase_ ): """simple docstring""" def __init__( self : int ): # test for the above condition ...
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : Tuple , lowerCAmelCase__ : Tuple ) -> Union[str, Any]: """simple docstring""" lowerCAmelCase_ : Optional[int] = [1] for i in range(2 , lowerCAme...
289
"""simple docstring""" import os from bleurt import score # From: git+https://github.com/google-research/bleurt.git import datasets lowercase__ : Tuple = datasets.logging.get_logger(__name__) lowercase__ : List[Any] = """\ @inproceedings{bleurt, titl...
289
1
"""simple docstring""" import torch from diffusers import CMStochasticIterativeScheduler from .test_schedulers import SchedulerCommonTest class UpperCamelCase__ ( lowercase_ ): """simple docstring""" _SCREAMING_SNAKE_CASE = ...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : Optional[Any] , lowerCAmelCase__ : str ) -> List[Any]: """simple docstring""" return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2 def UpperCamelCase_ ...
289
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_sentencepiece_available, is_tf_available, is_tokenizers_available, is_torch_available, ) if is_sentencepiec...
289
"""simple docstring""" from __future__ import annotations def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> list[int]: """simple docstring""" lowerCAmelCase_ : Any = 2 lowerCAmelCase_ : List[Any] = [] while...
289
1
"""simple docstring""" class UpperCamelCase__ : """simple docstring""" def __init__( self : int , SCREAMING_SNAKE_CASE_ : Tuple ): # we need a list not a string, so do something to change the type lowerCAmelCase_ ...
289
"""simple docstring""" import argparse import os # New Code # 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_sched...
289
1
"""simple docstring""" def UpperCamelCase_ ( ) -> List[str]: """simple docstring""" for n in range(1 , 100_0000 ): yield n * (n + 1) // 2 def UpperCamelCase_ ( lowerCAmelCase__ : Optional[Any] ) -> Dict: ""...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : list[int] , lowerCAmelCase__ : list[int] ) -> None: """simple docstring""" lowerCAmelCase_ : List[Any] = len(lowerCAmelCase__ ) print('The followin...
289
1
"""simple docstring""" from .constants import ( MODEL_NAME, OPTIMIZER_NAME, RNG_STATE_NAME, SAFE_WEIGHTS_INDEX_NAME, SAFE_WEIGHTS_NAME, SCALER_NAME, SCHEDULER_NAME, TORCH_LAUNCH_PARAMS, WEIGHTS_INDEX_NAME, WEIGHTS_NAME, ) from .dataclasses impor...
289
"""simple docstring""" from diffusers.utils.testing_utils import require_onnxruntime @require_onnxruntime class UpperCamelCase__ : """simple docstring""" pass
289
1
"""simple docstring""" import os from itertools import chain from random import randrange, shuffle import pytest from .sola import PokerHand lowercase__ : int = ( """4S 3H 2C 7S 5H""", """9D 8H 2C 6S 7H""", """2D 6D 9D TH 7D""", """TC 8C 2S JH 6C""", ...
289
"""simple docstring""" import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home lowercase__ : int = HUGGINGFACE_HUB_CACHE lowercase__ : Tuple = """config.json""" lowercase__ : Union[str, Any] = """diffusion_pytorc...
289
1
"""simple docstring""" from diffusers.utils.testing_utils import require_onnxruntime @require_onnxruntime class UpperCamelCase__ : """simple docstring""" pass
289
"""simple docstring""" import re def UpperCamelCase_ ( lowerCAmelCase__ : str ) -> bool: """simple docstring""" lowerCAmelCase_ : str = re.compile( R'^(?:0|94|\+94|0{2}94)' R'7(0|1|2|4|5|6|7|8)' R'(-| |)' R'\d{7}$' ) ...
289
1
"""simple docstring""" import unittest from diffusers.pipelines.pipeline_utils import is_safetensors_compatible class UpperCamelCase__ ( unittest.TestCase ): """simple docstring""" def SCREAMING_SNAKE_CASE__ ( self : D...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : str , lowerCAmelCase__ : str ) -> int: """simple docstring""" if len(lowerCAmelCase__ ) != len(lowerCAmelCase__ ): raise ValueError('String lengths must match...
289
1
"""simple docstring""" from ...utils import ( OptionalDependencyNotAvailable, is_flax_available, is_torch_available, is_transformers_available, ) try: if not (is_transformers_available() and is_torch_available()): raise OptionalDependencyNotAvailable() ...
289
"""simple docstring""" from __future__ import annotations from fractions import Fraction from math import gcd, sqrt def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> bool: """simple docstring""" lowerCAmelCase_ : int = int(num...
289
1
"""simple docstring""" from __future__ import annotations import copy import inspect import json import math import os import tempfile import unittest from importlib import import_module import numpy as np from transformers import ViTMAEConfig from transformers.file_utils import ...
289
"""simple docstring""" import unittest from transformers import AlbertConfig, is_torch_available from transformers.models.auto import get_values from transformers.testing_utils import require_torch, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_mod...
289
1
"""simple docstring""" from json import JSONDecodeError # Workaround for requests.exceptions.JSONDecodeError import requests def UpperCamelCase_ ( lowerCAmelCase__ : str = "isbn/0140328726" ) -> dict: """simple docstring""" lowerCAmelCase_ ...
289
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Dict = { """configuration_falcon""": ["""FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FalconCon...
289
1
"""simple docstring""" from collections import OrderedDict from typing import Mapping from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging lowercase__ : Union[str, Any] = logging.get_logger(__name__) lowercase_...
289
"""simple docstring""" from collections.abc import Iterable from typing import Generic, TypeVar lowercase__ : Any = TypeVar("""_T""") class UpperCamelCase__ ( Generic[_T] ): """simple docstring""" def __init__( self ...
289
1
"""simple docstring""" from __future__ import annotations def UpperCamelCase_ ( lowerCAmelCase__ : float , lowerCAmelCase__ : float , lowerCAmelCase__ : float ) -> float: """simple docstring""" if days_between_payments <...
289
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_torch_available, ) lowercase__ : Optional[int] = { """configuration_...
289
1
"""simple docstring""" import functools import gc import inspect import torch from .imports import is_npu_available, is_xpu_available def UpperCamelCase_ ( *lowerCAmelCase__ : str ) -> Union[str, Any]: """simple docstring""" if not isinstan...
289
"""simple docstring""" import logging from transformers.configuration_utils import PretrainedConfig lowercase__ : List[Any] = logging.getLogger(__name__) class UpperCamelCase__ ( lowercase_ ): """simple docstring""" ...
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : int = 200 ) -> int: """simple docstring""" lowerCAmelCase_ : Optional[Any] = [1, 2, 5, 10, 20, 50, 100, 200] lowerCAmelCase_ : Union[str, Any] = [0]...
289
"""simple docstring""" import random import timeit from functools import wraps from typing import Callable, Optional from ..configuration_utils import PretrainedConfig from ..models.auto.modeling_tf_auto import TF_MODEL_MAPPING, TF_MODEL_WITH_LM_HEAD_MAPPING from ..utils import is_pyanvml...
289
1
"""simple docstring""" import inspect import unittest import warnings from math import ceil, floor from transformers import LevitConfig from transformers.file_utils import cached_property, is_torch_available, is_vision_available from transformers.models.auto import get_values from transf...
289
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : List[Any] = logging.get_logger(__name__) lowercase__ : List[str] = { """s-JoL/Open-Llama-V1""": """https://huggingface.co/s-JoL/Open-Llam...
289
1
"""simple docstring""" from __future__ import annotations lowercase__ : Dict = 1_0 def UpperCamelCase_ ( lowerCAmelCase__ : list[int] ) -> list[int]: """simple docstring""" lowerCAmelCase_ : str = 1 lowerCAmelC...
289
"""simple docstring""" from typing import Dict, List, Optional, Union import numpy as np from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict from ...image_transforms import ( center_crop, get_resize_output_image_size, normalize, rescale...
289
1
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tf_available, is_tokenizers_available, is_torch_available, ) lowercase__ : Dict = {"""con...
289
"""simple docstring""" import baseaa def UpperCamelCase_ ( lowerCAmelCase__ : str ) -> bytes: """simple docstring""" return baseaa.aaaencode(string.encode('utf-8' ) ) def UpperCamelCase_ ( lowerCAmelCase__ : bytes ) ...
289
1
"""simple docstring""" from __future__ import annotations def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> list[int]: """simple docstring""" lowerCAmelCase_ : Any = 2 lowerCAmelCase_ : List[Any] = [] while...
289
"""simple docstring""" import os import tempfile import unittest from transformers import FlaubertConfig, is_torch_available from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_mod...
289
1
"""simple docstring""" import os import tempfile import unittest from pathlib import Path from transformers import AutoConfig, is_torch_available from transformers.testing_utils import require_torch, torch_device if is_torch_available(): from transformers import PyTorchBenchmark...
289
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices lowercase__ : Optional[int] = logging.get_logger(__name__) ...
289
1
"""simple docstring""" import logging import os import sys import warnings from dataclasses import dataclass, field from random import randint from typing import Optional import datasets import evaluate import numpy as np from datasets import DatasetDict, load_dataset import transf...
289
"""simple docstring""" from abc import ABC, abstractmethod from typing import List, Optional class UpperCamelCase__ ( lowercase_ ): """simple docstring""" def __init__( self : int ): # test for the above condition ...
289
1
"""simple docstring""" import dataclasses import json import warnings from dataclasses import dataclass, field from time import time from typing import List from ..utils import logging lowercase__ : Optional[int] = logging.get_logger(__name__) def UpperCamelCase_...
289
"""simple docstring""" import os from bleurt import score # From: git+https://github.com/google-research/bleurt.git import datasets lowercase__ : Tuple = datasets.logging.get_logger(__name__) lowercase__ : List[Any] = """\ @inproceedings{bleurt, titl...
289
1
"""simple docstring""" import gc import math import unittest import torch from diffusers import UNetaDModel from diffusers.utils import floats_tensor, logging, slow, torch_all_close, torch_device from diffusers.utils.testing_utils import enable_full_determinism from .test_modeling_co...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : Optional[Any] , lowerCAmelCase__ : str ) -> List[Any]: """simple docstring""" return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2 def UpperCamelCase_ ...
289
1
"""simple docstring""" from unittest import TestCase from datasets import Dataset from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters def UpperCamelCase_ ( ) -> Optional[int]: """simple docstring""" lowerCAmelCase_ : Tu...
289
"""simple docstring""" from __future__ import annotations def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> list[int]: """simple docstring""" lowerCAmelCase_ : Any = 2 lowerCAmelCase_ : List[Any] = [] while...
289
1
"""simple docstring""" from math import factorial, pi def UpperCamelCase_ ( lowerCAmelCase__ : float , lowerCAmelCase__ : int = 30 ) -> float: """simple docstring""" if not isinstance(lowerCAmelCase__ , (int, float) ): ...
289
"""simple docstring""" import argparse import os # New Code # 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_sched...
289
1
"""simple docstring""" from timeit import timeit def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> int: """simple docstring""" if number < 0: raise ValueError('the value of input must not be negative' ) lowerCAmelCase_ : str ...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : list[int] , lowerCAmelCase__ : list[int] ) -> None: """simple docstring""" lowerCAmelCase_ : List[Any] = len(lowerCAmelCase__ ) print('The followin...
289
1
"""simple docstring""" import math class UpperCamelCase__ : """simple docstring""" def SCREAMING_SNAKE_CASE__ ( self : List[Any] , SCREAMING_SNAKE_CASE_ : list[list[float]] , SCREAMING_SNAKE_CASE_ : l...
289
"""simple docstring""" from diffusers.utils.testing_utils import require_onnxruntime @require_onnxruntime class UpperCamelCase__ : """simple docstring""" pass
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : list[list[int]] , lowerCAmelCase__ : int , lowerCAmelCase__ : int , lowerCAmelCase__ : set ) -> int: """simple docstring""" lowerCAmelCase_ ...
289
"""simple docstring""" import os from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home lowercase__ : int = HUGGINGFACE_HUB_CACHE lowercase__ : Tuple = """config.json""" lowercase__ : Union[str, Any] = """diffusion_pytorc...
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : str , lowerCAmelCase__ : bool = False ) -> str: """simple docstring""" if not isinstance(lowerCAmelCase__ , lowerCAmelCase__ ): lowerCAmelCase_ : ...
289
"""simple docstring""" import re def UpperCamelCase_ ( lowerCAmelCase__ : str ) -> bool: """simple docstring""" lowerCAmelCase_ : str = re.compile( R'^(?:0|94|\+94|0{2}94)' R'7(0|1|2|4|5|6|7|8)' R'(-| |)' R'\d{7}$' ) ...
289
1
"""simple docstring""" import argparse from collections import defaultdict def UpperCamelCase_ ( lowerCAmelCase__ : Any , lowerCAmelCase__ : Union[str, Any] , lowerCAmelCase__ : int , lowerCAmelCase__ : Optional[Any] , lowerCAmel...
289
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : str , lowerCAmelCase__ : str ) -> int: """simple docstring""" if len(lowerCAmelCase__ ) != len(lowerCAmelCase__ ): raise ValueError('String lengths must match...
289
1
"""simple docstring""" def UpperCamelCase_ ( lowerCAmelCase__ : list , lowerCAmelCase__ : int , lowerCAmelCase__ : int = 0 , lowerCAmelCase__ : int = 0 ) -> int: """simple docstring""" lowerCAmelCase_ : ...
289
"""simple docstring""" from __future__ import annotations from fractions import Fraction from math import gcd, sqrt def UpperCamelCase_ ( lowerCAmelCase__ : int ) -> bool: """simple docstring""" lowerCAmelCase_ : int = int(num...
289
1
"""simple docstring""" import argparse import hashlib # hashlib is only used inside the Test class import struct class UpperCamelCase__ : """simple docstring""" def __init__( self : Dict , SCREAMING_SNAKE_CASE_ : Tupl...
289
"""simple docstring""" import unittest from transformers import AlbertConfig, is_torch_available from transformers.models.auto import get_values from transformers.testing_utils import require_torch, slow, torch_device from ...test_configuration_common import ConfigTester from ...test_mod...
289
1
"""simple docstring""" import numpy as np def UpperCamelCase_ ( lowerCAmelCase__ : np.array ) -> np.array: """simple docstring""" return 1 / (1 + np.exp(-vector )) if __name__ == "__main__": import doctest doctest.testmod() ...
289
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_torch_available, ) lowercase__ : Dict = { """configuration_falcon""": ["""FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FalconCon...
289
1
"""simple docstring""" from typing import List, Optional, Union import numpy as np from ....audio_utils import mel_filter_bank, optimal_fft_length, spectrogram, window_function from ....feature_extraction_sequence_utils import SequenceFeatureExtractor from ....feature_extraction_utils imp...
289
"""simple docstring""" from collections.abc import Iterable from typing import Generic, TypeVar lowercase__ : Any = TypeVar("""_T""") class UpperCamelCase__ ( Generic[_T] ): """simple docstring""" def __init__( self ...
289
1
"""simple docstring""" import numpy as np def UpperCamelCase_ ( lowerCAmelCase__ : Optional[int] , lowerCAmelCase__ : int , lowerCAmelCase__ : Optional[Any] , lowerCAmelCase__ : Optional[Any] , lowerCAmelCase__ : Dict )...
289
"""simple docstring""" from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_speech_available, is_torch_available, ) lowercase__ : Optional[int] = { """configuration_...
289
1
"""simple docstring""" import argparse import logging import os from datetime import datetime import numpy as np import torch from torch import nn from torch.utils.data import DataLoader, RandomSampler, TensorDataset from tqdm import tqdm from transformers import GPTaLMHeadModel ...
289
"""simple docstring""" import logging from transformers.configuration_utils import PretrainedConfig lowercase__ : List[Any] = logging.getLogger(__name__) class UpperCamelCase__ ( lowercase_ ): """simple docstring""" ...
289
1
"""simple docstring""" import importlib import os import sys # This is required to make the module import works (when the python process is running from the root of the repo) sys.path.append(""".""") def UpperCamelCase_ ( lowerCAmelCase__ : Tuple ) -> Opti...
289
"""simple docstring""" import random import timeit from functools import wraps from typing import Callable, Optional from ..configuration_utils import PretrainedConfig from ..models.auto.modeling_tf_auto import TF_MODEL_MAPPING, TF_MODEL_WITH_LM_HEAD_MAPPING from ..utils import is_pyanvml...
289
1
"""simple docstring""" from __future__ import annotations def UpperCamelCase_ ( lowerCAmelCase__ : list[int] , lowerCAmelCase__ : list[int] , lowerCAmelCase__ : list[int] , lowerCAmelCase__ : list[list[str]] , lowerCAmelCase__ ...
289
"""simple docstring""" from ...configuration_utils import PretrainedConfig from ...utils import logging lowercase__ : List[Any] = logging.get_logger(__name__) lowercase__ : List[str] = { """s-JoL/Open-Llama-V1""": """https://huggingface.co/s-JoL/Open-Llam...
289
1