python_code stringlengths 0 290k | repo_name stringclasses 30
values | file_path stringlengths 6 125 |
|---|---|---|
import logging
import os
from pathlib import Path
def prepare_logging(fid):
# Create the directory for log files (if it doesn't exist)
Path('./log_files').mkdir(exist_ok=True)
log_fid = Path(fid).stem
logs = logging.getLogger(log_fid)
logs.setLevel(logging.DEBUG)
logs.propagate = False
lo... | data-measurements-main | src/utils/__init__.py |
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | data-measurements-main | src/utils/dataset_utils.py |
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | data-measurements-main | src/utils/gradio_utils.py |
# flake8: noqa
# Copyright 2022 The HuggingFace Data-Measurements Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | data-measurements-main | src/data_measurements/__init__.py |
from typing import Callable, Dict, List, Optional, Type
from datasets import Dataset, load_dataset
from data_measurements.measurements import (
DataMeasurement,
DataMeasurementFactory,
DataMeasurementResults,
)
from data_measurements.measurements.base import Widget
class DataMeasurementSuite:
def __... | data-measurements-main | src/data_measurements/measurement_suite.py |
from datasets import Dataset
import pandas as pd
import gradio as gr
import nltk
from nltk.corpus import stopwords
from data_measurements.measurements.base import (
DataMeasurement,
DataMeasurementResults,
TokenizedDatasetMixin,
Widget
)
from data_measurements.measurements.text_duplicates import TextDu... | data-measurements-main | src/data_measurements/measurements/general_stats.py |
from statistics import mean, stdev
import gradio as gr
import matplotlib.pyplot as plt
import seaborn as sns
from datasets import Dataset
from pandas import DataFrame
from data_measurements.measurements.base import (
DataMeasurement,
DataMeasurementResults,
TokenizedDatasetMixin,
Widget
)
class Tex... | data-measurements-main | src/data_measurements/measurements/text_lengths.py |
from .base import DataMeasurement, DataMeasurementFactory, DataMeasurementResults
from .cooccurences import Cooccurences, CooccurencesResults
from .general_stats import GeneralStats, GeneralStatsResults
from .label_distribution import LabelDistribution, LabelDistributionResults
from .pmi import PMI, PMIResults
from .te... | data-measurements-main | src/data_measurements/measurements/__init__.py |
from datasets import Dataset
import utils.dataset_utils as ds_utils
import gradio as gr
from typing import Dict
from data_measurements.measurements.base import DataMeasurement, DataMeasurementResults, EvaluateMixin, Widget
class TextDuplicatesResults(DataMeasurementResults):
def __init__(
self,
... | data-measurements-main | src/data_measurements/measurements/text_duplicates.py |
import numpy.typing as np
import pandas as pd
from datasets import Dataset
from sklearn.preprocessing import MultiLabelBinarizer
from data_measurements.measurements.base import DataMeasurement, DataMeasurementResults, TokenizedDatasetMixin
def count_words_per_sentence(dataset, vocabulary) -> np.NDArray:
mlb = M... | data-measurements-main | src/data_measurements/measurements/cooccurences.py |
from datasets import Dataset
from data_measurements.measurements.cooccurences import Cooccurences, CooccurencesResults
class PMIResults(CooccurencesResults):
pass
class PMI(Cooccurences):
name = "PMI"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def measure(se... | data-measurements-main | src/data_measurements/measurements/pmi.py |
import abc
from abc import ABC
from typing import Callable, Dict, List, Type
import evaluate
from datasets import Dataset
from evaluate import load as load_metric
import gradio as gr
class DataMeasurementResults(ABC):
@abc.abstractmethod
def to_figure(self):
raise NotImplementedError()
@abc.abst... | data-measurements-main | src/data_measurements/measurements/base.py |
from typing import Dict, List
import plotly.express as px
from datasets import Dataset
import gradio as gr
from data_measurements.measurements.base import (
DataMeasurement,
DataMeasurementResults,
EvaluateMixin,
LabelMeasurementMixin,
Widget
)
import utils
logs = utils.prepare_logging(__file__)... | data-measurements-main | src/data_measurements/measurements/label_distribution.py |
from sklearn.feature_extraction.text import CountVectorizer
from data_measurements import DataMeasurementSuite
from data_measurements.measurements import Cooccurences
tokenizer = CountVectorizer(token_pattern="(?u)\\b\\w+\\b").build_tokenizer()
import time
t = time.time()
suite = DataMeasurementSuite(
datase... | data-measurements-main | src/sample_scripts/cooccurence_sample.py |
from data_measurements.measurements import TextDuplicates
from datasets import Dataset
dataset = Dataset.from_dict(
{
"text": ["Hello", "World", "Hello", "Foo Bar", "wasn", ""],
"label": [1, 2, 1, 1, 0, 0],
}
)
def tokenize(sentence: str):
return sentence.split()
TextDuplicates.standalo... | data-measurements-main | src/sample_scripts/launch_widget.py |
from transformers import AutoTokenizer
from data_measurements import DataMeasurementSuite
from data_measurements.measurements import LabelDistribution, TextDuplicates, TextLengths
gpt2_tokenizer = AutoTokenizer.from_pretrained("gpt2")
def tokenizer(x):
return gpt2_tokenizer(x)["input_ids"]
suite = DataMeasur... | data-measurements-main | src/sample_scripts/sample_script.py |
import json
import os
import tempfile
import time
from io import BytesIO
from mimetypes import guess_extension
from typing import Any, Dict, List, Optional, Tuple
import librosa
import psutil
import requests
import soundfile
import timm
import torch
import uvicorn
from asteroid import separate
from asteroid.models imp... | api-inference-community-master-old | main.py |
import os
import sys
import unittest
from mimetypes import guess_type
SRC_DIR = os.path.join(os.path.dirname(__file__), "..") # isort:skip
sys.path.append(SRC_DIR) # isort:skip
import requests
from main import (
EXAMPLE_ASR_EN_MODEL_ID,
EXAMPLE_SEP_ENH_MODEL_ID,
EXAMPLE_SEP_SEP_MODEL_ID,
EXAMPLE_T... | api-inference-community-master-old | tests/test_requests.py |
#!/usr/bin/env python
""" This script will clone the `datasets` repository in your current directory and parse all currently available
metadata, from the `README.md` yaml headers and the automatically generated json files.
It dumps the results in a `metadata_{current-commit-of-datasets}.json` file.
"""
import... | datasets-tagging-main | build_metadata_file.py |
import json
import logging
from pathlib import Path
from typing import Callable, Dict, List, Tuple
import langcodes as lc
import streamlit as st
import yaml
from datasets.utils.metadata import (
DatasetMetadata,
known_creators,
known_licenses,
known_multilingualities,
known_size_categories,
kno... | datasets-tagging-main | tagging_app.py |
from typing import Dict, List
def new_state() -> Dict[str, List]:
return {
"task_categories": [],
"task_ids": [],
"multilinguality": [],
"languages": [],
"language_creators": [],
"annotations_creators": [],
"source_datasets": [],
"size_categories": [... | datasets-tagging-main | apputils.py |
import argparse
import os
import re
import nbformat
import shutil
import yaml
from pathlib import Path
re_framework_test = re.compile(r"^{#if\s+fw\s+===\s+'([^']+)'}\s*$")
re_framework_else = re.compile(r"^{:else}\s*$")
re_framework_end = re.compile(r"^{/if}\s*$")
re_html_line = re.compile(r"^<[^>]*/>\s*$")
re_html_... | audio-transformers-course-main | utils/generate_notebooks.py |
import argparse
import black
import os
import re
from pathlib import Path
def blackify(filename, check_only=False):
# Read the content of the file
with open(filename, "r", encoding="utf-8") as f:
content = f.read()
lines = content.split("\n")
# Split the content into code samples in py or pyt... | audio-transformers-course-main | utils/code_formatter.py |
import argparse
import os
import yaml
from pathlib import Path
PATH_TO_COURSE = Path("chapters/")
def load_sections(language: str):
toc = yaml.safe_load(
open(os.path.join(PATH_TO_COURSE / language, "_toctree.yml"), "r")
)
sections = []
for chapter in toc:
for section in chapter["sect... | audio-transformers-course-main | utils/validate_translation.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | setup.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_modeling_common.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_utils.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | tests/conftest.py |
from diffusers.utils.testing_utils import require_torch
@require_torch
class PipelineTesterMixin:
"""
This mixin is designed to be used with unittest.TestCase classes.
It provides a set of common tests for each PyTorch pipeline, e.g. saving and loading the pipeline,
equivalence of dict and tuple outpu... | diffusers-ft-main | tests/test_pipelines_common.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_pipelines.py |
diffusers-ft-main | tests/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_scheduler_flax.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_scheduler.py |
from diffusers.utils.testing_utils import require_onnxruntime
@require_onnxruntime
class OnnxPipelineTesterMixin:
"""
This mixin is designed to be used with unittest.TestCase classes.
It provides a set of common tests for each ONNXRuntime pipeline, e.g. saving and loading the pipeline,
equivalence of ... | diffusers-ft-main | tests/test_pipelines_onnx_common.py |
import inspect
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax
if is_flax_available():
import jax
@require_flax
class FlaxModelTesterMixin:
def test_output(self):
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()
mo... | diffusers-ft-main | tests/test_modeling_common_flax.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_training.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_layers_utils.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_config.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/test_pipelines_flax.py |
import unittest
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
from diffusers.utils.outputs import BaseOutput
@dataclass
class CustomOutput(BaseOutput):
images: Union[List[PIL.Image.Image], np.ndarray]
class ConfigTester(unittest.TestCase):
def test_ou... | diffusers-ft-main | tests/test_outputs.py |
diffusers-ft-main | tests/pipelines/__init__.py | |
diffusers-ft-main | tests/pipelines/karras_ve/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/karras_ve/test_karras_ve.py |
diffusers-ft-main | tests/pipelines/repaint/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/repaint/test_repaint.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/ddim/test_ddim.py |
diffusers-ft-main | tests/pipelines/ddim/__init__.py | |
diffusers-ft-main | tests/pipelines/altdiffusion/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/altdiffusion/test_alt_diffusion_img2img.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/altdiffusion/test_alt_diffusion.py |
diffusers-ft-main | tests/pipelines/stable_diffusion_safe/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_safe/test_safe_diffusion.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/vq_diffusion/test_vq_diffusion.py |
diffusers-ft-main | tests/pipelines/vq_diffusion/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/latent_diffusion/test_latent_diffusion.py |
diffusers-ft-main | tests/pipelines/latent_diffusion/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/latent_diffusion/test_latent_diffusion_superresolution.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/latent_diffusion/test_latent_diffusion_uncond.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/dance_diffusion/test_dance_diffusion.py |
diffusers-ft-main | tests/pipelines/score_sde_ve/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/score_sde_ve/test_score_sde_ve.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_cycle_diffusion.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_stable_diffusion_img2img.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_stable_diffusion.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_stable_diffusion_inpaint.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_inpaint.py |
diffusers-ft-main | tests/pipelines/stable_diffusion/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_inpaint_legacy.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_stable_diffusion_image_variation.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion/test_stable_diffusion_inpaint_legacy.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/pndm/test_pndm.py |
diffusers-ft-main | tests/pipelines/pndm/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/versatile_diffusion/test_versatile_diffusion_dual_guided.py |
diffusers-ft-main | tests/pipelines/versatile_diffusion/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/versatile_diffusion/test_versatile_diffusion_image_variation.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/versatile_diffusion/test_versatile_diffusion_mega.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/versatile_diffusion/test_versatile_diffusion_text_to_image.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_2/test_stable_diffusion_flax.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_2/test_stable_diffusion.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_2/test_stable_diffusion_inpaint.py |
diffusers-ft-main | tests/pipelines/stable_diffusion_2/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py |
diffusers-ft-main | tests/pipelines/ddpm/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/pipelines/ddpm/test_ddpm.py |
import gc
import unittest
from diffusers import FlaxUNet2DConditionModel
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import load_hf_numpy, require_flax, slow
from parameterized import parameterized
if is_flax_available():
import jax
import jax.numpy as jnp
@slow
@requir... | diffusers-ft-main | tests/models/test_models_unet_2d_flax.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/models/test_models_unet_1d.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/models/test_models_unet_2d.py |
import unittest
from diffusers import FlaxAutoencoderKL
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax
from ..test_modeling_common_flax import FlaxModelTesterMixin
if is_flax_available():
import jax
@require_flax
class FlaxAutoencoderKLTests(FlaxModelTeste... | diffusers-ft-main | tests/models/test_models_vae_flax.py |
diffusers-ft-main | tests/models/__init__.py | |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/models/test_models_vq.py |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers-ft-main | tests/models/test_models_vae.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | tests/repo_utils/test_check_copies.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | tests/repo_utils/test_check_dummies.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | tests/fixtures/custom_pipeline/pipeline.py |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers-ft-main | tests/fixtures/custom_pipeline/what_ever.py |
# Copyright 2022 The HuggingFace Team, the AllenNLP library authors. 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
#
... | diffusers-ft-main | utils/stale.py |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | diffusers-ft-main | utils/print_env.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.