text stringlengths 96 319k | id stringlengths 14 178 | metadata dict |
|---|---|---|
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets 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
#
# U... | datasets/src/datasets/splits.py/0 | {
"file_path": "datasets/src/datasets/splits.py",
"repo_id": "datasets",
"token_count": 9577
} |
import re
import textwrap
from collections import Counter
from itertools import groupby
from operator import itemgetter
from typing import Any, ClassVar, Dict, List, Optional, Tuple
import yaml
from huggingface_hub import DatasetCardData
from ..config import METADATA_CONFIGS_FIELD
from ..features import Features
from... | datasets/src/datasets/utils/metadata.py/0 | {
"file_path": "datasets/src/datasets/utils/metadata.py",
"repo_id": "datasets",
"token_count": 4646
} |
---
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"
---
# Dataset Card for [Dataset Name]
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Dataset Description](#dataset-... | datasets/templates/README.md/0 | {
"file_path": "datasets/templates/README.md",
"repo_id": "datasets",
"token_count": 819
} |
from unittest.mock import patch
import pyspark
import pytest
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.packaged_modules.spark.spark import (
Spark,
SparkConfig,
SparkExamplesIterable,
_generate_iterable_examples,
)
from ..utils import (... | datasets/tests/packaged_modules/test_spark.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_spark.py",
"repo_id": "datasets",
"token_count": 2267
} |
import os
import re
from pathlib import Path
from unittest.mock import patch
import pytest
import zstandard as zstd
from fsspec.registry import _registry as _fsspec_registry
from fsspec.spec import AbstractBufferedFile, AbstractFileSystem
from huggingface_hub.errors import OfflineModeIsEnabled
from datasets.download.... | datasets/tests/test_file_utils.py/0 | {
"file_path": "datasets/tests/test_file_utils.py",
"repo_id": "datasets",
"token_count": 17517
} |
import os
import tempfile
from functools import partial
from unittest import TestCase
from unittest.mock import patch
import numpy as np
import pytest
from datasets.arrow_dataset import Dataset
from datasets.search import ElasticSearchIndex, FaissIndex, MissingIndex
from .utils import require_elasticsearch, require_... | datasets/tests/test_search.py/0 | {
"file_path": "datasets/tests/test_search.py",
"repo_id": "datasets",
"token_count": 4553
} |
import os
import sys
import torch
from diffusers import (
AutoPipelineForImage2Image,
AutoPipelineForInpainting,
AutoPipelineForText2Image,
ControlNetModel,
LCMScheduler,
StableDiffusionAdapterPipeline,
StableDiffusionControlNetPipeline,
StableDiffusionXLAdapterPipeline,
StableDiff... | diffusers/benchmarks/base_classes.py/0 | {
"file_path": "diffusers/benchmarks/base_classes.py",
"repo_id": "diffusers",
"token_count": 5583
} |
<!--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/ip_adapter.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/ip_adapter.md",
"repo_id": "diffusers",
"token_count": 388
} |
<!-- 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 agree... | diffusers/docs/source/en/api/models/autoencoderkl_allegro.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoderkl_allegro.md",
"repo_id": "diffusers",
"token_count": 427
} |
<!-- 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 applic... | diffusers/docs/source/en/api/pipelines/ltx_video.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/ltx_video.md",
"repo_id": "diffusers",
"token_count": 2911
} |
<!--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 to... | diffusers/docs/source/en/api/pipelines/shap_e.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/shap_e.md",
"repo_id": "diffusers",
"token_count": 590
} |
<!--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.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ddim.md",
"repo_id": "diffusers",
"token_count": 1122
} |
<!--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/lms_discrete.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/lms_discrete.md",
"repo_id": "diffusers",
"token_count": 335
} |
<!--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/optimization/open_vino.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/open_vino.md",
"repo_id": "diffusers",
"token_count": 1115
} |
# Create a dataset for training
There are many datasets on the [Hub](https://huggingface.co/datasets?task_categories=task_categories:text-to-image&sort=downloads) to train a model on, but if you can't find one you're interested in or want to use your own, you can create a dataset with the 🤗 [Datasets](https://hugging... | diffusers/docs/source/en/training/create_dataset.md/0 | {
"file_path": "diffusers/docs/source/en/training/create_dataset.md",
"repo_id": "diffusers",
"token_count": 1310
} |
<!--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/autopipeline.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/autopipeline.md",
"repo_id": "diffusers",
"token_count": 2061
} |
<!--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/image_quality.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/image_quality.md",
"repo_id": "diffusers",
"token_count": 2199
} |
<!--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/scheduler_features.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/scheduler_features.md",
"repo_id": "diffusers",
"token_count": 4053
} |
<!--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/quicktour.md/0 | {
"file_path": "diffusers/docs/source/ja/quicktour.md",
"repo_id": "diffusers",
"token_count": 7859
} |
<!--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/mps.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/mps.md",
"repo_id": "diffusers",
"token_count": 2538
} |
<!--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/other-formats.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/other-formats.md",
"repo_id": "diffusers",
"token_count": 6831
} |
# LoRA finetuning example for CogVideoX
Low-Rank Adaption of Large Language Models was first introduced by Microsoft in [LoRA: Low-Rank Adaptation of Large Language Models](https://arxiv.org/abs/2106.09685) by *Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen*.
... | diffusers/examples/cogvideo/README.md/0 | {
"file_path": "diffusers/examples/cogvideo/README.md",
"repo_id": "diffusers",
"token_count": 4734
} |
# 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/examples/community/fresco_v2v.py/0 | {
"file_path": "diffusers/examples/community/fresco_v2v.py",
"repo_id": "diffusers",
"token_count": 53457
} |
## ----------------------------------------------------------
# A SDXL pipeline can take unlimited weighted prompt
#
# Author: Andrew Zhu
# GitHub: https://github.com/xhinker
# Medium: https://medium.com/@xhinker
## -----------------------------------------------------------
import inspect
import os
from typing import... | diffusers/examples/community/lpw_stable_diffusion_xl.py/0 | {
"file_path": "diffusers/examples/community/lpw_stable_diffusion_xl.py",
"repo_id": "diffusers",
"token_count": 48188
} |
# Copyright 2024 The InstantX 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 l... | diffusers/examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py",
"repo_id": "diffusers",
"token_count": 22982
} |
import inspect
import os
import random
import re
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers.configuration_utils import FrozenDict
from diffusers.models import Autoencod... | diffusers/examples/community/wildcard_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/wildcard_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 9006
} |
# DreamBooth training example for FLUX.1 [dev]
[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_flux.py` script shows how to implement the training procedure and adapt it for [FLUX.1 [dev... | diffusers/examples/dreambooth/README_flux.md/0 | {
"file_path": "diffusers/examples/dreambooth/README_flux.md",
"repo_id": "diffusers",
"token_count": 3793
} |
# coding=utf-8
# Copyright 2025 suzukimain
#
# 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 t... | diffusers/examples/model_search/pipeline_easy.py/0 | {
"file_path": "diffusers/examples/model_search/pipeline_easy.py",
"repo_id": "diffusers",
"token_count": 39434
} |
compute_environment: LOCAL_MACHINE
debug: false
deepspeed_config:
gradient_accumulation_steps: 1
gradient_clipping: 1.0
offload_optimizer_device: cpu
offload_param_device: cpu
zero3_init_flag: false
zero_stage: 2
distributed_type: DEEPSPEED
downcast_bf16: 'no'
enable_cpu_affinity: false
machine_rank: 0
main... | diffusers/examples/research_projects/flux_lora_quantization/ds2.yaml/0 | {
"file_path": "diffusers/examples/research_projects/flux_lora_quantization/ds2.yaml",
"repo_id": "diffusers",
"token_count": 196
} |
# Generating images using Flux and PyTorch/XLA
The `flux_inference` script shows how to do image generation using Flux on TPU devices using PyTorch/XLA. It uses the pallas kernel for flash attention for faster generation.
It has been tested on [Trillium](https://cloud.google.com/blog/products/compute/introducing-tril... | diffusers/examples/research_projects/pytorch_xla/inference/flux/README.md/0 | {
"file_path": "diffusers/examples/research_projects/pytorch_xla/inference/flux/README.md",
"repo_id": "diffusers",
"token_count": 1997
} |
#!/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.py/0 | {
"file_path": "diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image.py",
"repo_id": "diffusers",
"token_count": 21063
} |
import argparse
import logging
import math
import os
import random
from pathlib import Path
import jax
import jax.numpy as jnp
import numpy as np
import optax
import PIL
import torch
import torch.utils.checkpoint
import transformers
from flax import jax_utils
from flax.training import train_state
from flax.training.co... | diffusers/examples/textual_inversion/textual_inversion_flax.py/0 | {
"file_path": "diffusers/examples/textual_inversion/textual_inversion_flax.py",
"repo_id": "diffusers",
"token_count": 11076
} |
import argparse
import os
import torch
from huggingface_hub import create_repo, upload_folder
from safetensors.torch import load_file, save_file
def convert_motion_module(original_state_dict):
converted_state_dict = {}
for k, v in original_state_dict.items():
if "pos_encoder" in k:
contin... | diffusers/scripts/convert_animatediff_motion_lora_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_animatediff_motion_lora_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 931
} |
import argparse
import os
import torch
from torchvision.datasets.utils import download_url
from diffusers import AutoencoderKL, DDIMScheduler, DiTPipeline, Transformer2DModel
pretrained_models = {512: "DiT-XL-2-512x512.pt", 256: "DiT-XL-2-256x256.pt"}
def download_model(model_name):
"""
Downloads a pre-tr... | diffusers/scripts/convert_dit_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_dit_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 3037
} |
import argparse
import os
import torch
from safetensors.torch import load_file
from transformers import AutoModel, AutoTokenizer
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler, LuminaNextDiT2DModel, LuminaText2ImgPipeline
def main(args):
# checkpoint from https://huggingface.co/Alpha-VLLM/... | diffusers/scripts/convert_lumina_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_lumina_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 3156
} |
import argparse
from contextlib import nullcontext
import safetensors.torch
import torch
from accelerate import init_empty_weights
from diffusers import AutoencoderKL, SD3Transformer2DModel
from diffusers.loaders.single_file_utils import convert_ldm_vae_checkpoint
from diffusers.models.modeling_utils import load_mode... | diffusers/scripts/convert_sd3_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_sd3_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 7598
} |
# Run inside root directory of official source code: https://github.com/dome272/wuerstchen/
import os
import torch
from transformers import AutoTokenizer, CLIPTextModel
from vqgan import VQModel
from diffusers import (
DDPMWuerstchenScheduler,
WuerstchenCombinedPipeline,
WuerstchenDecoderPipeline,
Wue... | diffusers/scripts/convert_wuerstchen.py/0 | {
"file_path": "diffusers/scripts/convert_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 2171
} |
# 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/textual_inversion.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/textual_inversion.py",
"repo_id": "diffusers",
"token_count": 12077
} |
# 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/autoencoders/autoencoder_kl.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_kl.py",
"repo_id": "diffusers",
"token_count": 10722
} |
# 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/controlnet_sparsectrl.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnet_sparsectrl.py",
"repo_id": "diffusers",
"token_count": 2376
} |
# 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_pytorch_utils.py/0 | {
"file_path": "diffusers/src/diffusers/models/modeling_flax_pytorch_utils.py",
"repo_id": "diffusers",
"token_count": 2325
} |
# Copyright 2024 Alpha-VLLM Authors 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
#
# Unles... | diffusers/src/diffusers/models/transformers/lumina_nextdit2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/lumina_nextdit2d.py",
"repo_id": "diffusers",
"token_count": 6306
} |
# 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.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_1d.py",
"repo_id": "diffusers",
"token_count": 4887
} |
# 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/vae_flax.py/0 | {
"file_path": "diffusers/src/diffusers/models/vae_flax.py",
"repo_id": "diffusers",
"token_count": 14479
} |
# Copyright 2024 Salesforce.com, inc.
# 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... | diffusers/src/diffusers/pipelines/blip_diffusion/pipeline_blip_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/blip_diffusion/pipeline_blip_diffusion.py",
"repo_id": "diffusers",
"token_count": 6599
} |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_flax_available,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transfor... | diffusers/src/diffusers/pipelines/controlnet/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/controlnet/__init__.py",
"repo_id": "diffusers",
"token_count": 1545
} |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_latent_diffusion_uncond": ["LDMPipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_latent_diffusion_uncond import LDMPipeline
else:
import sys
sys.modules[__name__]... | diffusers/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/__init__.py",
"repo_id": "diffusers",
"token_count": 190
} |
# 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/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py",
"repo_id": "diffusers",
"token_count": 18223
} |
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 = {}
_additional_imports = {}
_import_structure = {"pipeline_output": ["FluxPipe... | diffusers/src/diffusers/pipelines/flux/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/flux/__init__.py",
"repo_id": "diffusers",
"token_count": 1276
} |
# 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_combined.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py",
"repo_id": "diffusers",
"token_count": 18875
} |
# Copyright 2024 ChatGLM3-6B Model Team, Kwai-Kolors 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... | diffusers/src/diffusers/pipelines/kolors/tokenizer.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kolors/tokenizer.py",
"repo_id": "diffusers",
"token_count": 5907
} |
from dataclasses import dataclass
import torch
from diffusers.utils import BaseOutput
@dataclass
class LTXPipelineOutput(BaseOutput):
r"""
Output class for LTX pipelines.
Args:
frames (`torch.Tensor`, `np.ndarray`, or List[List[PIL.Image.Image]]):
List of video outputs - It can be a... | diffusers/src/diffusers/pipelines/ltx/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/ltx/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 222
} |
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Optional, Union
import numpy as np
import PIL
from PIL import Image
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_... | diffusers/src/diffusers/pipelines/paint_by_example/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/paint_by_example/__init__.py",
"repo_id": "diffusers",
"token_count": 599
} |
import inspect
from itertools import repeat
from typing import Callable, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from ...image_processor import VaeImageProcessor
from ...models import AutoencoderKL, UNet2DConditionModel
from ...pipelines.stable_diff... | diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 18171
} |
# 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_xl/pipeline_flax_stable_diffusion_xl.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py",
"repo_id": "diffusers",
"token_count": 5263
} |
import copy
import inspect
from dataclasses import dataclass
from typing import Callable, List, Optional, Union
import numpy as np
import PIL.Image
import torch
import torch.nn.functional as F
from torch.nn.functional import grid_sample
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from ..... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py",
"repo_id": "diffusers",
"token_count": 20293
} |
# 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.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 9338
} |
# Copyright 2024 ParaDiGMS authors 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/schedulers/scheduling_ddpm_parallel.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_parallel.py",
"repo_id": "diffusers",
"token_count": 13226
} |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class LMSDiscreteScheduler(metaclass=DummyObject):
_backends = ["torch", "scipy"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "scipy"])
@class... | diffusers/src/diffusers/utils/dummy_torch_and_scipy_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_torch_and_scipy_objects.py",
"repo_id": "diffusers",
"token_count": 220
} |
from typing import List
import PIL.Image
import PIL.ImageOps
from packaging import version
from PIL import Image
if version.parse(version.parse(PIL.__version__).base_version) >= version.parse("9.1.0"):
PIL_INTERPOLATION = {
"linear": PIL.Image.Resampling.BILINEAR,
"bilinear": PIL.Image.Resampling... | diffusers/src/diffusers/utils/pil_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/pil_utils.py",
"repo_id": "diffusers",
"token_count": 849
} |
# 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 agreed to in writ... | diffusers/tests/lora/test_lora_layers_ltx_video.py/0 | {
"file_path": "diffusers/tests/lora/test_lora_layers_ltx_video.py",
"repo_id": "diffusers",
"token_count": 2180
} |
# 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_oobleck.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_autoencoder_oobleck.py",
"repo_id": "diffusers",
"token_count": 3771
} |
# 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_aura_flow.py/0 | {
"file_path": "diffusers/tests/models/transformers/test_models_transformer_aura_flow.py",
"repo_id": "diffusers",
"token_count": 1118
} |
# 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.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_2d.py",
"repo_id": "diffusers",
"token_count": 6472
} |
import pickle as pkl
import unittest
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
from diffusers.utils.outputs import BaseOutput
from diffusers.utils.testing_utils import require_torch
@dataclass
class CustomOutput(BaseOutput):
images: Union[List[PIL.Image... | diffusers/tests/others/test_outputs.py/0 | {
"file_path": "diffusers/tests/others/test_outputs.py",
"repo_id": "diffusers",
"token_count": 1506
} |
import unittest
import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
import diffusers
from diffusers import (
AnimateDiffVideoToVideoPipeline,
AutoencoderKL,
DDIMScheduler,
DPMSolverMultistepScheduler,
LCMScheduler,
MotionA... | diffusers/tests/pipelines/animatediff/test_animatediff_video2video.py/0 | {
"file_path": "diffusers/tests/pipelines/animatediff/test_animatediff_video2video.py",
"repo_id": "diffusers",
"token_count": 10229
} |
# Copyright 2024 The HuggingFace 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 law or agreed to in... | diffusers/tests/pipelines/cogview3/test_cogview3plus.py/0 | {
"file_path": "diffusers/tests/pipelines/cogview3/test_cogview3plus.py",
"repo_id": "diffusers",
"token_count": 4394
} |
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModel, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
FluxControlNetImg2ImgPipeline,
FluxControlNetModel,
FluxTransformer2DModel,
)... | diffusers/tests/pipelines/controlnet_flux/test_controlnet_flux_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet_flux/test_controlnet_flux_img2img.py",
"repo_id": "diffusers",
"token_count": 4397
} |
import tempfile
import numpy as np
import torch
from transformers import AutoTokenizer, T5EncoderModel
from diffusers import DDPMScheduler, UNet2DConditionModel
from diffusers.models.attention_processor import AttnAddedKVProcessor
from diffusers.pipelines.deepfloyd_if import IFWatermarker
from diffusers.utils.testing... | diffusers/tests/pipelines/deepfloyd_if/__init__.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/__init__.py",
"repo_id": "diffusers",
"token_count": 4583
} |
# 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.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky.py",
"repo_id": "diffusers",
"token_count": 4070
} |
import inspect
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
SD3Transformer2DModel,
StableDiffusion3PAGPipeline,
... | diffusers/tests/pipelines/pag/test_pag_sd3.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_sd3.py",
"repo_id": "diffusers",
"token_count": 5329
} |
# 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.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 6756
} |
# 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_latent_upscale.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py",
"repo_id": "diffusers",
"token_count": 5875
} |
# 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/tests/quantization/torchao/test_torchao.py/0 | {
"file_path": "diffusers/tests/quantization/torchao/test_torchao.py",
"repo_id": "diffusers",
"token_count": 17641
} |
import torch
from diffusers import EulerAncestralDiscreteScheduler
from diffusers.utils.testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class EulerAncestralDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EulerAncestralDiscreteScheduler,)
num_inference_step... | diffusers/tests/schedulers/test_scheduler_euler_ancestral.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_euler_ancestral.py",
"repo_id": "diffusers",
"token_count": 2492
} |
# 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_benchmarking_status.py/0 | {
"file_path": "diffusers/utils/notify_benchmarking_status.py",
"repo_id": "diffusers",
"token_count": 699
} |
This tutorial explains how to use [Moss v1](https://github.com/jess-moss/moss-robot-arms) with LeRobot.
## Source the parts
Follow this [README](https://github.com/jess-moss/moss-robot-arms). It contains the bill of materials, with link to source the parts, as well as the instructions to 3D print the parts, and advic... | lerobot/examples/11_use_moss.md/0 | {
"file_path": "lerobot/examples/11_use_moss.md",
"repo_id": "lerobot",
"token_count": 5335
} |
#!/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/factory.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/factory.py",
"repo_id": "lerobot",
"token_count": 1906
} |
#!/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/_encode_datasets.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/_encode_datasets.py",
"repo_id": "lerobot",
"token_count": 2733
} |
from dataclasses import dataclass, field
from lerobot.common.optim.optimizers import AdamWConfig
from lerobot.common.optim.schedulers import (
CosineDecayWithWarmupSchedulerConfig,
)
from lerobot.configs.policies import PreTrainedConfig
from lerobot.configs.types import FeatureType, NormalizationMode, PolicyFeatur... | lerobot/lerobot/common/policies/pi0/configuration_pi0.py/0 | {
"file_path": "lerobot/lerobot/common/policies/pi0/configuration_pi0.py",
"repo_id": "lerobot",
"token_count": 1875
} |
"""
This file contains utilities for recording frames from Intel Realsense cameras.
"""
import argparse
import concurrent.futures
import logging
import math
import shutil
import threading
import time
import traceback
from collections import Counter
from pathlib import Path
from threading import Thread
import numpy as... | lerobot/lerobot/common/robot_devices/cameras/intelrealsense.py/0 | {
"file_path": "lerobot/lerobot/common/robot_devices/cameras/intelrealsense.py",
"repo_id": "lerobot",
"token_count": 8222
} |
#!/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/utils/benchmark.py/0 | {
"file_path": "lerobot/lerobot/common/utils/benchmark.py",
"repo_id": "lerobot",
"token_count": 1033
} |
import os
import time
from pathlib import Path
from serial.tools import list_ports # Part of pyserial library
def find_available_ports():
if os.name == "nt": # Windows
# List COM ports using pyserial
ports = [port.device for port in list_ports.comports()]
else: # Linux/macOS
# List... | lerobot/lerobot/scripts/find_motors_bus_port.py/0 | {
"file_path": "lerobot/lerobot/scripts/find_motors_bus_port.py",
"repo_id": "lerobot",
"token_count": 508
} |
#!/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/tests/lerobot/common/datasets/test_utils.py/0 | {
"file_path": "lerobot/tests/lerobot/common/datasets/test_utils.py",
"repo_id": "lerobot",
"token_count": 435
} |
import queue
import time
from multiprocessing import queues
from unittest.mock import MagicMock, patch
import numpy as np
import pytest
from PIL import Image
from lerobot.common.datasets.image_writer import (
AsyncImageWriter,
image_array_to_image,
safe_stop_image_writer,
write_image,
)
DUMMY_IMAGE =... | lerobot/tests/test_image_writer.py/0 | {
"file_path": "lerobot/tests/test_image_writer.py",
"repo_id": "lerobot",
"token_count": 5192
} |
# Model arguments
model_name_or_path: Qwen/Qwen2.5-Math-7B
model_revision: main
torch_dtype: bfloat16
attn_implementation: flash_attention_2
# Data training arguments
dataset_name: DigitalLearningGmbH/MATH-lighteval
dataset_configs:
- train
# Num processes is less by 1 as vLLM is using 1 GPU
num_processes: 7
# GRPO t... | open-r1/recipes/Qwen2.5-Math-7B/grpo/config_simple_rl.yaml/0 | {
"file_path": "open-r1/recipes/Qwen2.5-Math-7B/grpo/config_simple_rl.yaml",
"repo_id": "open-r1",
"token_count": 420
} |
"""Reward functions for GRPO training."""
import math
import re
from latex2sympy2_extended import NormalizationConfig
from math_verify import LatexExtractionConfig, parse, verify
def accuracy_reward(completions, solution, **kwargs):
"""Reward function that checks if the completion is the same as the ground trut... | open-r1/src/open_r1/rewards.py/0 | {
"file_path": "open-r1/src/open_r1/rewards.py",
"repo_id": "open-r1",
"token_count": 2787
} |
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" ... | peft/docs/Makefile/0 | {
"file_path": "peft/docs/Makefile",
"repo_id": "peft",
"token_count": 237
} |
<!--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... | peft/docs/source/developer_guides/model_merging.md/0 | {
"file_path": "peft/docs/source/developer_guides/model_merging.md",
"repo_id": "peft",
"token_count": 2547
} |
<!--Copyright 2023 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... | peft/docs/source/package_reference/tuners.md/0 | {
"file_path": "peft/docs/source/package_reference/tuners.md",
"repo_id": "peft",
"token_count": 330
} |
IDX=$1
PROMPT_IDX=$((IDX % 25))
CLASS_IDX=$((IDX % 30))
# Define the UNIQUE_TOKEN, CLASS_TOKENs, and SUBJECT_NAMES
UNIQUE_TOKEN="qwe"
SUBJECT_NAMES=(
"backpack" "backpack_dog" "bear_plushie" "berry_bowl" "can"
"candle" "cat" "cat2" "clock" "colorful_sneaker"
"dog" "dog2" "dog3" "dog5" "dog6"
"dog7" "d... | peft/examples/boft_dreambooth/train_dreambooth.sh/0 | {
"file_path": "peft/examples/boft_dreambooth/train_dreambooth.sh",
"repo_id": "peft",
"token_count": 3412
} |
<jupyter_start><jupyter_code>from datasets import load_dataset
from transformers import set_seed, AutoModelForSeq2SeqLM, AutoTokenizer
from peft import get_peft_model, MultitaskPromptTuningConfig, TaskType, MultitaskPromptTuningInit
set_seed(42)
model_name = "google/flan-t5-base"
peft_config = MultitaskPromptTuningC... | peft/examples/conditional_generation/multitask_prompt_tuning.ipynb/0 | {
"file_path": "peft/examples/conditional_generation/multitask_prompt_tuning.ipynb",
"repo_id": "peft",
"token_count": 3341
} |
<jupyter_start><jupyter_text>CPT Training and InferenceThis notebook demonstrates the training and evaluation process of Context-Aware Prompt Tuning (CPT) using the Hugging Face Trainer. For more details, refer to the [Paper](https://huggingface.co/papers/2410.17222). Sections Overview:1. **Setup**: Import libraries an... | peft/examples/cpt_finetuning/cpt_train_and_inference.ipynb/0 | {
"file_path": "peft/examples/cpt_finetuning/cpt_train_and_inference.ipynb",
"repo_id": "peft",
"token_count": 6570
} |
<jupyter_start><jupyter_text>Finetuning Whisper-large-V2 on Colab using PEFT-Lora + BNB INT8 training In this Colab, we present a step-by-step guide on how to fine-tune Whisper for any multilingual ASR dataset using Hugging Face 🤗 Transformers and 🤗 PEFT. Using 🤗 PEFT and `bitsandbytes`, you can train the `whisper-l... | peft/examples/int8_training/peft_bnb_whisper_large_v2_training.ipynb/0 | {
"file_path": "peft/examples/int8_training/peft_bnb_whisper_large_v2_training.ipynb",
"repo_id": "peft",
"token_count": 7713
} |
<jupyter_start><jupyter_text>Using PEFT with custom models `peft` allows us to fine-tune models efficiently with LoRA. In this short notebook, we will demonstrate how to train a simple multilayer perceptron (MLP) using `peft`. Imports Make sure that you have the latest version of `peft` installed. To ensure that, run ... | peft/examples/multilayer_perceptron/multilayer_perceptron_lora.ipynb/0 | {
"file_path": "peft/examples/multilayer_perceptron/multilayer_perceptron_lora.ipynb",
"repo_id": "peft",
"token_count": 4094
} |
accelerate launch --config_file "configs/fsdp_config.yaml" train.py \
--seed 100 \
--model_name_or_path "meta-llama/Llama-2-70b-hf" \
--dataset_name "smangrul/ultrachat-10k-chatml" \
--chat_template_format "chatml" \
--add_special_tokens False \
--append_concat_token False \
--splits "train,test" \
--max_seq_len 2048 ... | peft/examples/sft/run_peft_fsdp.sh/0 | {
"file_path": "peft/examples/sft/run_peft_fsdp.sh",
"repo_id": "peft",
"token_count": 453
} |
"""
Utility to clean cache files that exceed a specific time in days according to their
last access time recorded in the cache.
Exit code:
- 1 if no candidates are found
- 0 if candidates are found
Deletion can be enabled by passing `-d` parameter, otherwise it will only list the candidates.
"""
import sys
from date... | peft/scripts/ci_clean_cache.py/0 | {
"file_path": "peft/scripts/ci_clean_cache.py",
"repo_id": "peft",
"token_count": 807
} |
# Copyright 2023-present 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 law or... | peft/src/peft/tuners/loha/model.py/0 | {
"file_path": "peft/src/peft/tuners/loha/model.py",
"repo_id": "peft",
"token_count": 1880
} |
# Copyright 2023-present 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 law or... | peft/src/peft/tuners/lora/layer.py/0 | {
"file_path": "peft/src/peft/tuners/lora/layer.py",
"repo_id": "peft",
"token_count": 37815
} |
# Copyright 2023-present 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 law or... | peft/src/peft/tuners/p_tuning/model.py/0 | {
"file_path": "peft/src/peft/tuners/p_tuning/model.py",
"repo_id": "peft",
"token_count": 2476
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.