text stringlengths 96 319k | id stringlengths 14 178 | metadata dict |
|---|---|---|
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of... | datasets/CODE_OF_CONDUCT.md/0 | {
"file_path": "datasets/CODE_OF_CONDUCT.md",
"repo_id": "datasets",
"token_count": 1208
} |
# Process audio data
This guide shows specific methods for processing audio datasets. Learn how to:
- Resample the sampling rate.
- Use [`~Dataset.map`] with audio datasets.
For a guide on how to process any type of dataset, take a look at the <a class="underline decoration-sky-400 decoration-2 font-semibold" href="... | datasets/docs/source/audio_process.mdx/0 | {
"file_path": "datasets/docs/source/audio_process.mdx",
"repo_id": "datasets",
"token_count": 1186
} |
# Share a dataset using the CLI
At Hugging Face, we are on a mission to democratize good Machine Learning and we believe in the value of open source. That's why we designed 🤗 Datasets so that anyone can share a dataset with the greater ML community. There are currently thousands of datasets in over 100 languages in t... | datasets/docs/source/share.mdx/0 | {
"file_path": "datasets/docs/source/share.mdx",
"repo_id": "datasets",
"token_count": 2959
} |
# Load video data
<Tip warning={true}>
Video support is experimental and is subject to change.
</Tip>
Video datasets have [`Video`] type columns, which contain `decord` objects.
<Tip>
To work with video datasets, you need to have the `decord` package installed. Check out the [installation](https://github.com/dml... | datasets/docs/source/video_load.mdx/0 | {
"file_path": "datasets/docs/source/video_load.mdx",
"repo_id": "datasets",
"token_count": 1462
} |
import logging
import os
from argparse import ArgumentParser
from pathlib import Path
from shutil import copyfile, rmtree
from typing import Generator, Optional
import datasets.config
from datasets.builder import DatasetBuilder
from datasets.commands import BaseDatasetsCLICommand
from datasets.download.download_manage... | datasets/src/datasets/commands/test.py/0 | {
"file_path": "datasets/src/datasets/commands/test.py",
"repo_id": "datasets",
"token_count": 4309
} |
import importlib
import shutil
import warnings
from typing import List
import fsspec
import fsspec.asyn
from fsspec.implementations.local import LocalFileSystem
from . import compression
COMPRESSION_FILESYSTEMS: List[compression.BaseCompressedFileFileSystem] = [
compression.Bz2FileSystem,
compression.GzipFi... | datasets/src/datasets/filesystems/__init__.py/0 | {
"file_path": "datasets/src/datasets/filesystems/__init__.py",
"repo_id": "datasets",
"token_count": 564
} |
from typing import Callable, Optional
from .. import Features, NamedSplit, Split
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class GeneratorDatasetInputStream(AbstractDatasetInputStream):
def __init__(
self,
generator: Callable,
... | datasets/src/datasets/io/generator.py/0 | {
"file_path": "datasets/src/datasets/io/generator.py",
"repo_id": "datasets",
"token_count": 920
} |
import glob
import json
import os
import shutil
import time
from pathlib import Path
from typing import List, Optional, Tuple, Union
import pyarrow as pa
import datasets
import datasets.config
import datasets.data_files
from datasets.naming import camelcase_to_snakecase, filenames_for_dataset_split
logger = dataset... | datasets/src/datasets/packaged_modules/cache/cache.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/cache/cache.py",
"repo_id": "datasets",
"token_count": 3788
} |
import os
import posixpath
import uuid
from dataclasses import dataclass
from itertools import islice
from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union
import numpy as np
import pyarrow as pa
import datasets
from datasets.arrow_writer import ArrowWriter, ParquetWriter
from datasets.config impor... | datasets/src/datasets/packaged_modules/spark/spark.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/spark/spark.py",
"repo_id": "datasets",
"token_count": 6937
} |
import importlib
import inspect
from functools import wraps
from typing import TYPE_CHECKING, Optional
from .download.download_config import DownloadConfig
from .utils.file_utils import (
xbasename,
xdirname,
xet_parse,
xexists,
xgetsize,
xglob,
xgzip_open,
xisdir,
xisfile,
xjoi... | datasets/src/datasets/streaming.py/0 | {
"file_path": "datasets/src/datasets/streaming.py",
"repo_id": "datasets",
"token_count": 2362
} |
from importlib import import_module
from .logging import get_logger
logger = get_logger(__name__)
class _PatchedModuleObj:
"""Set all the modules components as attributes of the _PatchedModuleObj object."""
def __init__(self, module, attrs=None):
attrs = attrs or []
if module is not None:
... | datasets/src/datasets/utils/patching.py/0 | {
"file_path": "datasets/src/datasets/utils/patching.py",
"repo_id": "datasets",
"token_count": 2222
} |
---
TODO: "Add YAML tags here. Delete these instructions and copy-paste the YAML tags obtained with the online tagging app: https://huggingface.co/spaces/huggingface/datasets-tagging"
YAML tags: "Find the full spec here: https://github.com/huggingface/hub-docs/blob/main/datasetcard.md?plain=1"
---
# Dataset Card Creat... | datasets/templates/README_guide.md/0 | {
"file_path": "datasets/templates/README_guide.md",
"repo_id": "datasets",
"token_count": 3276
} |
import csv
import os
import fsspec
import pytest
from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
from datasets.io.csv import CsvDatasetReader, CsvDatasetWriter
from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
def _check_csv_dataset(dataset, expected_feat... | datasets/tests/io/test_csv.py/0 | {
"file_path": "datasets/tests/io/test_csv.py",
"repo_id": "datasets",
"token_count": 2970
} |
import os
from datasets.utils._filelock import FileLock
def test_long_path(tmpdir):
filename = "a" * 1000 + ".lock"
lock1 = FileLock(str(tmpdir / filename))
assert lock1.lock_file.endswith(".lock")
assert not lock1.lock_file.endswith(filename)
assert len(os.path.basename(lock1.lock_file)) <= 255
| datasets/tests/test_filelock.py/0 | {
"file_path": "datasets/tests/test_filelock.py",
"repo_id": "datasets",
"token_count": 120
} |
import pytest
from datasets.utils.sharding import _distribute_shards, _number_of_shards_in_gen_kwargs, _split_gen_kwargs
@pytest.mark.parametrize(
"kwargs, expected",
[
({"num_shards": 0, "max_num_jobs": 1}, []),
({"num_shards": 10, "max_num_jobs": 1}, [range(10)]),
({"num_shards": 10... | datasets/tests/test_sharding_utils.py/0 | {
"file_path": "datasets/tests/test_sharding_utils.py",
"repo_id": "datasets",
"token_count": 977
} |
import argparse
import sys
sys.path.append(".")
from base_classes import ControlNetBenchmark, ControlNetSDXLBenchmark # noqa: E402
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--ckpt",
type=str,
default="lllyasviel/sd-controlnet-canny",
... | diffusers/benchmarks/benchmark_controlnet.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_controlnet.py",
"repo_id": "diffusers",
"token_count": 352
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/loaders/lora.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/lora.md",
"repo_id": "diffusers",
"token_count": 984
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/models/autoencoderkl_cogvideox.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoderkl_cogvideox.md",
"repo_id": "diffusers",
"token_count": 450
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/deepfloyd_if.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/deepfloyd_if.md",
"repo_id": "diffusers",
"token_count": 6743
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_audio.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_audio.md",
"repo_id": "diffusers",
"token_count": 1437
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_xl.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_xl.md",
"repo_id": "diffusers",
"token_count": 1005
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/ddim_inverse.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ddim_inverse.md",
"repo_id": "diffusers",
"token_count": 284
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/multistep_dpm_solver.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/multistep_dpm_solver.md",
"repo_id": "diffusers",
"token_count": 602
} |
# ParaAttention
<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/para-attn/flux-performance.png">
</div>
<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/d... | diffusers/docs/source/en/optimization/para_attn.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/para_attn.md",
"repo_id": "diffusers",
"token_count": 6509
} |
<!--Copyright 2024 Custom Diffusion authors 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... | diffusers/docs/source/en/training/custom_diffusion.md/0 | {
"file_path": "diffusers/docs/source/en/training/custom_diffusion.md",
"repo_id": "diffusers",
"token_count": 5488
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/tutorials/basic_training.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/basic_training.md",
"repo_id": "diffusers",
"token_count": 6242
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/img2img.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/img2img.md",
"repo_id": "diffusers",
"token_count": 9691
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/schedulers.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/schedulers.md",
"repo_id": "diffusers",
"token_count": 3407
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ja/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/ja/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6259
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/optimization/onnx.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/onnx.md",
"repo_id": "diffusers",
"token_count": 1448
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/training/text2image.md/0 | {
"file_path": "diffusers/docs/source/ko/training/text2image.md",
"repo_id": "diffusers",
"token_count": 6021
} |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/using-diffusers/push_to_hub.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/push_to_hub.md",
"repo_id": "diffusers",
"token_count": 3793
} |
import inspect
from typing import Any, Dict, List, Optional, Union
import torch
import torch.nn as nn
from transformers import AutoModel, AutoTokenizer, CLIPImageProcessor
from diffusers import DiffusionPipeline
from diffusers.image_processor import VaeImageProcessor
from diffusers.loaders import StableDiffusionLoraL... | diffusers/examples/community/gluegen.py/0 | {
"file_path": "diffusers/examples/community/gluegen.py",
"repo_id": "diffusers",
"token_count": 16739
} |
from typing import Union
import torch
from PIL import Image
from torchvision import transforms as tfms
from tqdm.auto import tqdm
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
... | diffusers/examples/community/magic_mix.py/0 | {
"file_path": "diffusers/examples/community/magic_mix.py",
"repo_id": "diffusers",
"token_count": 2446
} |
# Copyright 2024 Black Forest Labs and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | diffusers/examples/community/pipeline_flux_semantic_guidance.py/0 | {
"file_path": "diffusers/examples/community/pipeline_flux_semantic_guidance.py",
"repo_id": "diffusers",
"token_count": 31101
} |
# Inspired by: https://github.com/Mikubill/sd-webui-controlnet/discussions/1236 and https://github.com/Mikubill/sd-webui-controlnet/discussions/1280
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from diffusers import StableDiffusionControlNetPipe... | diffusers/examples/community/stable_diffusion_controlnet_reference.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_controlnet_reference.py",
"repo_id": "diffusers",
"token_count": 21059
} |
# DreamBooth training example for SANA
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_lora_sana.py` script shows how to implement the training procedure with [LoRA](https://huggingface.... | diffusers/examples/dreambooth/README_sana.md/0 | {
"file_path": "diffusers/examples/dreambooth/README_sana.md",
"repo_id": "diffusers",
"token_count": 1534
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/examples/dreambooth/test_dreambooth_lora_sd3.py/0 | {
"file_path": "diffusers/examples/dreambooth/test_dreambooth_lora_sd3.py",
"repo_id": "diffusers",
"token_count": 5605
} |
# Diffusion Model Alignment Using Direct Preference Optimization
This directory provides LoRA implementations of Diffusion DPO proposed in [DiffusionModel Alignment Using Direct Preference Optimization](https://arxiv.org/abs/2311.12908) by Bram Wallace, Meihua Dang, Rafael Rafailov, Linqi Zhou, Aaron Lou, Senthil Puru... | diffusers/examples/research_projects/diffusion_dpo/README.md/0 | {
"file_path": "diffusers/examples/research_projects/diffusion_dpo/README.md",
"repo_id": "diffusers",
"token_count": 1255
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | diffusers/examples/research_projects/flux_lora_quantization/train_dreambooth_lora_flux_miniature.py/0 | {
"file_path": "diffusers/examples/research_projects/flux_lora_quantization/train_dreambooth_lora_flux_miniature.py",
"repo_id": "diffusers",
"token_count": 21042
} |
import argparse
import itertools
import math
import os
import random
from pathlib import Path
import intel_extension_for_pytorch as ipex
import numpy as np
import PIL
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
... | diffusers/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py/0 | {
"file_path": "diffusers/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py",
"repo_id": "diffusers",
"token_count": 10732
} |
import argparse
import itertools
import json
import logging
import math
import uuid
import warnings
from os import environ, listdir, makedirs
from os.path import basename, join
from pathlib import Path
from typing import List
import datasets
import numpy as np
import torch
import torch.nn.functional as F
import torch.... | diffusers/examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py/0 | {
"file_path": "diffusers/examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py",
"repo_id": "diffusers",
"token_count": 21771
} |
from argparse import ArgumentParser
from pathlib import Path
from time import perf_counter
import structlog
import torch
import torch_xla.core.xla_model as xm
import torch_xla.debug.metrics as met
import torch_xla.debug.profiler as xp
import torch_xla.distributed.xla_multiprocessing as xmp
import torch_xla.runtime as ... | diffusers/examples/research_projects/pytorch_xla/inference/flux/flux_inference.py/0 | {
"file_path": "diffusers/examples/research_projects/pytorch_xla/inference/flux/flux_inference.py",
"repo_id": "diffusers",
"token_count": 2063
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora.py/0 | {
"file_path": "diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora.py",
"repo_id": "diffusers",
"token_count": 19853
} |
import argparse
import torch
from safetensors.torch import load_file
from diffusers import MotionAdapter
def convert_motion_module(original_state_dict):
converted_state_dict = {}
for k, v in original_state_dict.items():
if "pos_encoder" in k:
continue
else:
converted... | diffusers/scripts/convert_animatediff_motion_module_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_animatediff_motion_module_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 873
} |
import argparse
from contextlib import nullcontext
import safetensors.torch
import torch
from accelerate import init_empty_weights
from huggingface_hub import hf_hub_download
from diffusers import AutoencoderKL, FluxTransformer2DModel
from diffusers.loaders.single_file_utils import convert_ldm_vae_checkpoint
from dif... | diffusers/scripts/convert_flux_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_flux_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 6444
} |
import argparse
from contextlib import nullcontext
import torch
from accelerate import init_empty_weights
from safetensors.torch import load_file
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import AutoencoderKLMochi, FlowMatchEulerDiscreteScheduler, MochiPipeline, MochiTransformer3DModel
from ... | diffusers/scripts/convert_mochi_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_mochi_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 11174
} |
import argparse
import tempfile
import torch
from accelerate import load_checkpoint_and_dispatch
from diffusers.models.transformers.prior_transformer import PriorTransformer
from diffusers.pipelines.shap_e import ShapERenderer
"""
Example - From the diffusers root directory:
Download weights:
```sh
$ wget "https:... | diffusers/scripts/convert_shap_e_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_shap_e_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 22932
} |
"""
This script modified from
https://github.com/huggingface/diffusers/blob/bc691231360a4cbc7d19a58742ebb8ed0f05e027/scripts/convert_original_stable_diffusion_to_diffusers.py
Convert original Zero1to3 checkpoint to diffusers checkpoint.
# run the convert script
$ python convert_zero123_to_diffusers.py \
--checkpoi... | diffusers/scripts/convert_zero123_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_zero123_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 15250
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/experimental/rl/value_guided_sampling.py/0 | {
"file_path": "diffusers/src/diffusers/experimental/rl/value_guided_sampling.py",
"repo_id": "diffusers",
"token_count": 2639
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/loaders/transformer_flux.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/transformer_flux.py",
"repo_id": "diffusers",
"token_count": 3756
} |
# Copyright 2024 The RhymesAI and The HuggingFace Team.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | diffusers/src/diffusers/models/autoencoders/autoencoder_kl_allegro.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_kl_allegro.py",
"repo_id": "diffusers",
"token_count": 22707
} |
from ...utils import is_flax_available, is_torch_available
if is_torch_available():
from .controlnet import ControlNetModel, ControlNetOutput
from .controlnet_flux import FluxControlNetModel, FluxControlNetOutput, FluxMultiControlNetModel
from .controlnet_hunyuan import (
HunyuanControlNetOutput,
... | diffusers/src/diffusers/models/controlnets/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/__init__.py",
"repo_id": "diffusers",
"token_count": 331
} |
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/src/diffusers/models/modeling_flax_utils.py/0 | {
"file_path": "diffusers/src/diffusers/models/modeling_flax_utils.py",
"repo_id": "diffusers",
"token_count": 11809
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/transformers/pixart_transformer_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/pixart_transformer_2d.py",
"repo_id": "diffusers",
"token_count": 8737
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/unets/unet_1d_blocks.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_1d_blocks.py",
"repo_id": "diffusers",
"token_count": 11970
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/vq_model.py/0 | {
"file_path": "diffusers/src/diffusers/models/vq_model.py",
"repo_id": "diffusers",
"token_count": 490
} |
from ...models.controlnets.multicontrolnet import MultiControlNetModel
from ...utils import deprecate, logging
logger = logging.get_logger(__name__)
class MultiControlNetModel(MultiControlNetModel):
def __init__(self, *args, **kwargs):
deprecation_message = "Importing `MultiControlNetModel` from `diffus... | diffusers/src/diffusers/pipelines/controlnet/multicontrolnet.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/controlnet/multicontrolnet.py",
"repo_id": "diffusers",
"token_count": 217
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py",
"repo_id": "diffusers",
"token_count": 2148
} |
# Copyright 2024 Black Forest Labs and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | diffusers/src/diffusers/pipelines/flux/modeling_flux.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/flux/modeling_flux.py",
"repo_id": "diffusers",
"token_count": 519
} |
# Copyright 2024 The HunyuanVideo Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | diffusers/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py",
"repo_id": "diffusers",
"token_count": 13945
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py",
"repo_id": "diffusers",
"token_count": 6234
} |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and i... | diffusers/src/diffusers/pipelines/latent_consistency_models/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/latent_consistency_models/__init__.py",
"repo_id": "diffusers",
"token_count": 615
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_xl.py",
"repo_id": "diffusers",
"token_count": 37576
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/paint_by_example/image_encoder.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/paint_by_example/image_encoder.py",
"repo_id": "diffusers",
"token_count": 942
} |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/shap_e/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/shap_e/__init__.py",
"repo_id": "diffusers",
"token_count": 939
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py",
"repo_id": "diffusers",
"token_count": 19929
} |
# Copyright 2024 The GLIGEN Authors and 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 re... | diffusers/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py",
"repo_id": "diffusers",
"token_count": 23187
} |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
from ...utils import BaseOutput, is_flax_available
@dataclass
class StableDiffusionXLPipelineOutput(BaseOutput):
"""
Output class for Stable Diffusion pipelines.
Args:
images (`List[PIL.Image.Im... | diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 401
} |
import copy
import inspect
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL
import torch
import torch.nn.functional as F
from torch.nn.functional import grid_sample
from transformers import (
CLIPImageProcessor,
CLIPTextModel,
... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py",
"repo_id": "diffusers",
"token_count": 28929
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_combined.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_combined.py",
"repo_id": "diffusers",
"token_count": 6952
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/schedulers/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/__init__.py",
"repo_id": "diffusers",
"token_count": 4369
} |
# Copyright (c) 2022 Pablo Pernías MIT License
# Copyright 2024 UC Berkeley Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... | diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 3645
} |
# Copyright 2024 Zhejiang University Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | diffusers/src/diffusers/schedulers/scheduling_ipndm.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ipndm.py",
"repo_id": "diffusers",
"token_count": 3642
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/schedulers/scheduling_utils.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_utils.py",
"repo_id": "diffusers",
"token_count": 3405
} |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class CosineDPMSolverMultistepScheduler(metaclass=DummyObject):
_backends = ["torch", "torchsde"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "torc... | diffusers/src/diffusers/utils/dummy_torch_and_torchsde_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_torch_and_torchsde_objects.py",
"repo_id": "diffusers",
"token_count": 416
} |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/utils/state_dict_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/state_dict_utils.py",
"repo_id": "diffusers",
"token_count": 5996
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/models/autoencoders/test_models_autoencoder_tiny.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_autoencoder_tiny.py",
"repo_id": "diffusers",
"token_count": 4073
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/models/transformers/test_models_transformer_cogvideox.py/0 | {
"file_path": "diffusers/tests/models/transformers/test_models_transformer_cogvideox.py",
"repo_id": "diffusers",
"token_count": 2166
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/models/unets/test_models_unet_2d_condition.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_2d_condition.py",
"repo_id": "diffusers",
"token_count": 27414
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/others/test_training.py/0 | {
"file_path": "diffusers/tests/others/test_training.py",
"repo_id": "diffusers",
"token_count": 1481
} |
import random
import unittest
import numpy as np
import torch
# torch_device, # {{ edit_1 }} Removed unused import
from transformers import (
AutoTokenizer,
CLIPTextConfig,
CLIPTextModel,
CLIPTokenizer,
T5EncoderModel,
)
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteSchedu... | diffusers/tests/pipelines/controlnet_flux/test_controlnet_flux_inpaint.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet_flux/test_controlnet_flux_inpaint.py",
"repo_id": "diffusers",
"token_count": 3792
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/deepfloyd_if/test_if.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if.py",
"repo_id": "diffusers",
"token_count": 2031
} |
import gc
import unittest
import numpy as np
import pytest
import torch
from diffusers import FluxPipeline, FluxPriorReduxPipeline
from diffusers.utils import load_image
from diffusers.utils.testing_utils import (
numpy_cosine_similarity_distance,
require_big_gpu_with_torch_cuda,
slow,
torch_device,
)... | diffusers/tests/pipelines/flux/test_pipeline_flux_redux.py/0 | {
"file_path": "diffusers/tests/pipelines/flux/test_pipeline_flux_redux.py",
"repo_id": "diffusers",
"token_count": 1828
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_combined.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_combined.py",
"repo_id": "diffusers",
"token_count": 6141
} |
import gc
import inspect
import random
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
AutoPipelineForImage2Image,
FlowMatchEulerDiscreteScheduler,
... | diffusers/tests/pipelines/pag/test_pag_sd3_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_sd3_img2img.py",
"repo_id": "diffusers",
"token_count": 4732
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/pndm/test_pndm.py/0 | {
"file_path": "diffusers/tests/pipelines/pndm/test_pndm.py",
"repo_id": "diffusers",
"token_count": 1314
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py",
"repo_id": "diffusers",
"token_count": 4278
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py",
"repo_id": "diffusers",
"token_count": 8448
} |
import gc
import unittest
import torch
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DDPMScheduler,
PriorTransformer,
StableUnCLIPPipeline,
UNet2DConditionModel,
)
from diffusers.pipeline... | diffusers/tests/pipelines/stable_unclip/test_stable_unclip.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_unclip/test_stable_unclip.py",
"repo_id": "diffusers",
"token_count": 4023
} |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/schedulers/test_scheduler_flax.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_flax.py",
"repo_id": "diffusers",
"token_count": 18884
} |
import tempfile
from io import BytesIO
import requests
import torch
from huggingface_hub import hf_hub_download, snapshot_download
from diffusers.loaders.single_file_utils import _extract_repo_id_and_weights_name
from diffusers.models.attention_processor import AttnProcessor
from diffusers.utils.testing_utils import ... | diffusers/tests/single_file/single_file_testing_utils.py/0 | {
"file_path": "diffusers/tests/single_file/single_file_testing_utils.py",
"repo_id": "diffusers",
"token_count": 7707
} |
import gc
import unittest
import torch
from diffusers import (
DDIMScheduler,
StableDiffusionXLImg2ImgPipeline,
)
from diffusers.utils import load_image
from diffusers.utils.testing_utils import (
backend_empty_cache,
enable_full_determinism,
numpy_cosine_similarity_distance,
require_torch_acc... | diffusers/tests/single_file/test_stable_diffusion_xl_img2img_single_file.py/0 | {
"file_path": "diffusers/tests/single_file/test_stable_diffusion_xl_img2img_single_file.py",
"repo_id": "diffusers",
"token_count": 1770
} |
# coding=utf-8
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | diffusers/utils/notify_community_pipelines_mirror.py/0 | {
"file_path": "diffusers/utils/notify_community_pipelines_mirror.py",
"repo_id": "diffusers",
"token_count": 679
} |
"""
This script demonstrates the use of `LeRobotDataset` class for handling and processing robotic datasets from Hugging Face.
It illustrates how to load datasets, manipulate them, and apply transformations suitable for machine learning tasks in PyTorch.
Features included in this script:
- Viewing a dataset's metadata... | lerobot/examples/1_load_lerobot_dataset.py/0 | {
"file_path": "lerobot/examples/1_load_lerobot_dataset.py",
"repo_id": "lerobot",
"token_count": 1864
} |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/datasets/image_writer.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/image_writer.py",
"repo_id": "lerobot",
"token_count": 2388
} |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/datasets/push_dataset_to_hub/_umi_imagecodecs_numcodecs.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/_umi_imagecodecs_numcodecs.py",
"repo_id": "lerobot",
"token_count": 5297
} |
import abc
from dataclasses import dataclass, field
import draccus
from lerobot.common.constants import ACTION, OBS_ENV, OBS_IMAGE, OBS_IMAGES, OBS_ROBOT
from lerobot.configs.types import FeatureType, PolicyFeature
@dataclass
class EnvConfig(draccus.ChoiceRegistry, abc.ABC):
task: str | None = None
fps: int... | lerobot/lerobot/common/envs/configs.py/0 | {
"file_path": "lerobot/lerobot/common/envs/configs.py",
"repo_id": "lerobot",
"token_count": 2092
} |
import torch
from lerobot.common.datasets.lerobot_dataset import LeRobotDataset
from lerobot.common.policies.factory import make_policy
from lerobot.configs.policies import PreTrainedConfig
torch.backends.cudnn.benchmark = True
def main():
device = "cuda"
dataset_repo_id = "danaaubakirova/koch_test"
# m... | lerobot/lerobot/common/policies/pi0/conversion_scripts/benchmark.py/0 | {
"file_path": "lerobot/lerobot/common/policies/pi0/conversion_scripts/benchmark.py",
"repo_id": "lerobot",
"token_count": 823
} |
"""
This file contains utilities for recording frames from cameras. For more info look at `OpenCVCamera` docstring.
"""
import argparse
import concurrent.futures
import math
import platform
import shutil
import threading
import time
from pathlib import Path
from threading import Thread
import numpy as np
from PIL imp... | lerobot/lerobot/common/robot_devices/cameras/opencv.py/0 | {
"file_path": "lerobot/lerobot/common/robot_devices/cameras/opencv.py",
"repo_id": "lerobot",
"token_count": 7825
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.