text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
# Copyright 2025 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/audioldm/pipeline_audioldm.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/audioldm/pipeline_audioldm.py",
"repo_id": "diffusers",
"token_count": 11698
} | 163 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
import torch
from diffusers.utils import BaseOutput, get_logger
logger = get_logger(__name__)
@dataclass
class CosmosPipelineOutput(BaseOutput):
r"""
Output class for Cosmos any-to-world/video pipelines.
... | diffusers/src/diffusers/pipelines/cosmos/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/cosmos/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 446
} | 164 |
fast27_timesteps = [
999,
800,
799,
600,
599,
500,
400,
399,
377,
355,
333,
311,
288,
266,
244,
222,
200,
199,
177,
155,
133,
111,
88,
66,
44,
22,
0,
]
smart27_timesteps = [
999,
976,
952,
928,
... | diffusers/src/diffusers/pipelines/deepfloyd_if/timesteps.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/timesteps.py",
"repo_id": "diffusers",
"token_count": 3772
} | 165 |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_repaint": ["RePaintPipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_repaint import RePaintPipeline
else:
import sys
sys.modules[__name__] = _LazyModule(
... | diffusers/src/diffusers/pipelines/deprecated/repaint/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/repaint/__init__.py",
"repo_id": "diffusers",
"token_count": 183
} | 166 |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_stochastic_karras_ve": ["KarrasVePipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_stochastic_karras_ve import KarrasVePipeline
else:
import sys
sys.modules[__na... | diffusers/src/diffusers/pipelines/deprecated/stochastic_karras_ve/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/stochastic_karras_ve/__init__.py",
"repo_id": "diffusers",
"token_count": 199
} | 167 |
from dataclasses import dataclass
import torch
from diffusers.utils import BaseOutput
@dataclass
class EasyAnimatePipelineOutput(BaseOutput):
r"""
Output class for EasyAnimate pipelines.
Args:
frames (`torch.Tensor`, `np.ndarray`, or List[List[PIL.Image.Image]]):
List of video outpu... | diffusers/src/diffusers/pipelines/easyanimate/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/easyanimate/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 225
} | 168 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
import torch
from ...utils import BaseOutput
@dataclass
class FluxPipelineOutput(BaseOutput):
"""
Output class for Flux image generation pipelines.
Args:
images (`List[PIL.Image.Image]` or `torc... | diffusers/src/diffusers/pipelines/flux/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/flux/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 467
} | 169 |
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/kandinsky/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky/__init__.py",
"repo_id": "diffusers",
"token_count": 951
} | 170 |
# Copyright 2025 Alpha-VLLM 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 requir... | diffusers/src/diffusers/pipelines/lumina2/pipeline_lumina2.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/lumina2/pipeline_lumina2.py",
"repo_id": "diffusers",
"token_count": 16735
} | 171 |
# Copyright 2025 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/pag_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/pag/pag_utils.py",
"repo_id": "diffusers",
"token_count": 4377
} | 172 |
# Copyright 2025 Open AI 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 required ... | diffusers/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py",
"repo_id": "diffusers",
"token_count": 5823
} | 173 |
# Stable Diffusion
## Overview
Stable Diffusion was proposed in [Stable Diffusion Announcement](https://stability.ai/blog/stable-diffusion-announcement) by Patrick Esser and Robin Rombach and the Stability AI team.
The summary of the model is the following:
*Stable Diffusion is a text-to-image model that will empow... | diffusers/src/diffusers/pipelines/stable_diffusion/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/README.md",
"repo_id": "diffusers",
"token_count": 2487
} | 174 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL
import torch
from ...utils import (
BaseOutput,
)
@dataclass
class TextToVideoSDPipelineOutput(BaseOutput):
"""
Output class for text-to-video pipelines.
Args:
frames (`torch.Tensor`, `np.ndarra... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 272
} | 175 |
# Copyright 2025 VisualCloze 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
#
# Unless ... | diffusers/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py",
"repo_id": "diffusers",
"token_count": 20123
} | 176 |
# 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/LICENSE-2.0
#
# Unless required by appl... | diffusers/src/diffusers/quantizers/torchao/torchao_quantizer.py/0 | {
"file_path": "diffusers/src/diffusers/quantizers/torchao/torchao_quantizer.py",
"repo_id": "diffusers",
"token_count": 6593
} | 177 |
# Copyright 2025 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py",
"repo_id": "diffusers",
"token_count": 5290
} | 178 |
# Copyright 2025 Stability AI, Katherine Crowson 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-... | diffusers/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_flow_match_heun_discrete.py",
"repo_id": "diffusers",
"token_count": 5283
} | 179 |
# Copyright 2025 Google Brain 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 requ... | diffusers/src/diffusers/schedulers/scheduling_sde_ve_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_sde_ve_flax.py",
"repo_id": "diffusers",
"token_count": 4805
} | 180 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class GGUFQuantizationConfig(metaclass=DummyObject):
_backends = ["gguf"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["gguf"])
@classmethod
def fro... | diffusers/src/diffusers/utils/dummy_gguf_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_gguf_objects.py",
"repo_id": "diffusers",
"token_count": 198
} | 181 |
import io
import random
import struct
import tempfile
from contextlib import contextmanager
from typing import List, Optional, Union
import numpy as np
import PIL.Image
import PIL.ImageOps
from .import_utils import BACKENDS_MAPPING, is_imageio_available, is_opencv_available
from .logging import get_logger
global_rn... | diffusers/src/diffusers/utils/export_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/export_utils.py",
"repo_id": "diffusers",
"token_count": 3217
} | 182 |
# Copyright 2025 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/video_processor.py/0 | {
"file_path": "diffusers/src/diffusers/video_processor.py",
"repo_id": "diffusers",
"token_count": 2249
} | 183 |
# coding=utf-8
# Copyright 2025 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/lora/test_lora_layers_qwenimage.py/0 | {
"file_path": "diffusers/tests/lora/test_lora_layers_qwenimage.py",
"repo_id": "diffusers",
"token_count": 1775
} | 184 |
# coding=utf-8
# Copyright 2025 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_kl_temporal_decoder.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_autoencoder_kl_temporal_decoder.py",
"repo_id": "diffusers",
"token_count": 873
} | 185 |
import unittest
from unittest.mock import patch
from transformers import CLIPTextModel, LongformerModel
from diffusers.models import AutoModel, UNet2DConditionModel
class TestAutoModel(unittest.TestCase):
@patch(
"diffusers.models.AutoModel.load_config",
side_effect=[EnvironmentError("File not f... | diffusers/tests/models/test_models_auto.py/0 | {
"file_path": "diffusers/tests/models/test_models_auto.py",
"repo_id": "diffusers",
"token_count": 526
} | 186 |
# coding=utf-8
# Copyright 2025 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_hidream.py/0 | {
"file_path": "diffusers/tests/models/transformers/test_models_transformer_hidream.py",
"repo_id": "diffusers",
"token_count": 1434
} | 187 |
# Copyright 2025 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/tests/others/test_check_dummies.py/0 | {
"file_path": "diffusers/tests/others/test_check_dummies.py",
"repo_id": "diffusers",
"token_count": 1872
} | 188 |
# Copyright 2025 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/cogvideo/test_cogvideox_fun_control.py/0 | {
"file_path": "diffusers/tests/pipelines/cogvideo/test_cogvideox_fun_control.py",
"repo_id": "diffusers",
"token_count": 5782
} | 189 |
# coding=utf-8
# Copyright 2025 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/controlnet/test_controlnet_sdxl.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet/test_controlnet_sdxl.py",
"repo_id": "diffusers",
"token_count": 19964
} | 190 |
# Copyright 2025 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/easyanimate/test_easyanimate.py/0 | {
"file_path": "diffusers/tests/pipelines/easyanimate/test_easyanimate.py",
"repo_id": "diffusers",
"token_count": 4867
} | 191 |
# Copyright 2025 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/hunyuan_video/test_hunyuan_skyreels_image2video.py/0 | {
"file_path": "diffusers/tests/pipelines/hunyuan_video/test_hunyuan_skyreels_image2video.py",
"repo_id": "diffusers",
"token_count": 5971
} | 192 |
# coding=utf-8
# Copyright 2025 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_controlnet_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet_img2img.py",
"repo_id": "diffusers",
"token_count": 4829
} | 193 |
# coding=utf-8
# Copyright 2025 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/latent_diffusion/test_latent_diffusion_superresolution.py/0 | {
"file_path": "diffusers/tests/pipelines/latent_diffusion/test_latent_diffusion_superresolution.py",
"repo_id": "diffusers",
"token_count": 2028
} | 194 |
# Copyright 2023-2025 Marigold Team, ETH Zürich. All rights reserved.
# Copyright 2024-2025 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
#
# ... | diffusers/tests/pipelines/marigold/test_marigold_depth.py/0 | {
"file_path": "diffusers/tests/pipelines/marigold/test_marigold_depth.py",
"repo_id": "diffusers",
"token_count": 8630
} | 195 |
# 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/skyreels_v2/test_skyreels_v2_df_image_to_video.py/0 | {
"file_path": "diffusers/tests/pipelines/skyreels_v2/test_skyreels_v2_df_image_to_video.py",
"repo_id": "diffusers",
"token_count": 3445
} | 196 |
# coding=utf-8
# Copyright 2025 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_stable_diffusion_inpaint.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion_inpaint.py",
"repo_id": "diffusers",
"token_count": 21271
} | 197 |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion_adapter/test_stable_diffusion_adapter.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_adapter/test_stable_diffusion_adapter.py",
"repo_id": "diffusers",
"token_count": 14060
} | 198 |
# coding=utf-8
# Copyright 2025 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/test_pipelines_auto.py/0 | {
"file_path": "diffusers/tests/pipelines/test_pipelines_auto.py",
"repo_id": "diffusers",
"token_count": 12243
} | 199 |
The tests here are adapted from [`transformers` tests](https://github.com/huggingface/transformers/tree/409fcfdfccde77a14b7cc36972b774cabc371ae1/tests/quantization/bnb).
They were conducted on the `audace` machine, using a single RTX 4090. Below is `nvidia-smi`:
```bash
+----------------------------------------------... | diffusers/tests/quantization/bnb/README.md/0 | {
"file_path": "diffusers/tests/quantization/bnb/README.md",
"repo_id": "diffusers",
"token_count": 1033
} | 200 |
# coding=utf-8
# Copyright 2025 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/remote/test_remote_encode.py/0 | {
"file_path": "diffusers/tests/remote/test_remote_encode.py",
"repo_id": "diffusers",
"token_count": 3055
} | 201 |
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
} | 202 |
import gc
import unittest
import torch
from diffusers import (
StableDiffusionInpaintPipeline,
)
from diffusers.utils import load_image
from diffusers.utils.testing_utils import (
backend_empty_cache,
enable_full_determinism,
require_torch_accelerator,
slow,
torch_device,
)
from .single_file_... | diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py/0 | {
"file_path": "diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py",
"repo_id": "diffusers",
"token_count": 2043
} | 203 |
#!/usr/bin/env python
import argparse
import glob
import os
import re
from datetime import date, datetime
from slack_sdk import WebClient
from tabulate import tabulate
MAX_LEN_MESSAGE = 3001 # slack endpoint has a limit of 3001 characters
parser = argparse.ArgumentParser()
parser.add_argument("--slack_channel_name... | diffusers/utils/consolidated_test_report.py/0 | {
"file_path": "diffusers/utils/consolidated_test_report.py",
"repo_id": "diffusers",
"token_count": 16966
} | 204 |
# 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
#
# Unless required by appl... | lerobot/.dockerignore/0 | {
"file_path": "lerobot/.dockerignore",
"repo_id": "lerobot",
"token_count": 885
} | 205 |
#!/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/benchmarks/video/run_video_benchmark.py/0 | {
"file_path": "lerobot/benchmarks/video/run_video_benchmark.py",
"repo_id": "lerobot",
"token_count": 8161
} | 206 |
# Installation
## Environment Setup
Create a virtual environment with Python 3.10, using [`Miniconda`](https://docs.anaconda.com/miniconda/install/#quick-command-line-install)
```bash
conda create -y -n lerobot python=3.10
```
Then activate your conda environment, you have to do this each time you open a shell to u... | lerobot/docs/source/installation.mdx/0 | {
"file_path": "lerobot/docs/source/installation.mdx",
"repo_id": "lerobot",
"token_count": 1166
} | 207 |
This tutorial will explain the training script, how to use it, and particularly how to configure everything needed for the training run.
> **Note:** The following assumes you're running these commands on a machine equipped with a cuda GPU. If you don't have one (or if you're using a Mac), you can add `--policy.device=... | lerobot/examples/4_train_policy_with_script.md/0 | {
"file_path": "lerobot/examples/4_train_policy_with_script.md",
"repo_id": "lerobot",
"token_count": 4877
} | 208 |
# 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
#
# Unless required by appl... | lerobot/src/lerobot/cameras/realsense/configuration_realsense.py/0 | {
"file_path": "lerobot/src/lerobot/cameras/realsense/configuration_realsense.py",
"repo_id": "lerobot",
"token_count": 1321
} | 209 |
#!/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/src/lerobot/datasets/push_dataset_to_hub/utils.py/0 | {
"file_path": "lerobot/src/lerobot/datasets/push_dataset_to_hub/utils.py",
"repo_id": "lerobot",
"token_count": 1935
} | 210 |
#!/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/src/lerobot/find_cameras.py/0 | {
"file_path": "lerobot/src/lerobot/find_cameras.py",
"repo_id": "lerobot",
"token_count": 4659
} | 211 |
# 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
#
# Unless required by appl... | lerobot/src/lerobot/policies/pi0/paligemma_with_expert.py/0 | {
"file_path": "lerobot/src/lerobot/policies/pi0/paligemma_with_expert.py",
"repo_id": "lerobot",
"token_count": 8263
} | 212 |
## Paper
https://sjlee.cc/vq-bet/
## Citation
```bibtex
@article{lee2024behavior,
title={Behavior generation with latent actions},
author={Lee, Seungjae and Wang, Yibin and Etukuru, Haritheja and Kim, H Jin and Shafiullah, Nur Muhammad Mahi and Pinto, Lerrel},
journal={arXiv preprint arXiv:2403.03181},
year=... | lerobot/src/lerobot/policies/vqbet/README.md/0 | {
"file_path": "lerobot/src/lerobot/policies/vqbet/README.md",
"repo_id": "lerobot",
"token_count": 125
} | 213 |
# 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
#
# Unless required by appl... | lerobot/src/lerobot/robots/robot.py/0 | {
"file_path": "lerobot/src/lerobot/robots/robot.py",
"repo_id": "lerobot",
"token_count": 2592
} | 214 |
# 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/LICENSE-2.0
#
# Unless required by appl... | lerobot/src/lerobot/scripts/server/robot_client.py/0 | {
"file_path": "lerobot/src/lerobot/scripts/server/robot_client.py",
"repo_id": "lerobot",
"token_count": 8968
} | 215 |
#!/usr/bin/env python
# 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/LICENSE-2.0
#
# ... | lerobot/src/lerobot/teleoperators/so101_leader/so101_leader.py/0 | {
"file_path": "lerobot/src/lerobot/teleoperators/so101_leader/so101_leader.py",
"repo_id": "lerobot",
"token_count": 2435
} | 216 |
#!/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/src/lerobot/utils/benchmark.py/0 | {
"file_path": "lerobot/src/lerobot/utils/benchmark.py",
"repo_id": "lerobot",
"token_count": 1035
} | 217 |
#!/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/src/lerobot/utils/wandb_utils.py/0 | {
"file_path": "lerobot/src/lerobot/utils/wandb_utils.py",
"repo_id": "lerobot",
"token_count": 2912
} | 218 |
#!/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/datasets/test_sampler.py/0 | {
"file_path": "lerobot/tests/datasets/test_sampler.py",
"repo_id": "lerobot",
"token_count": 1423
} | 219 |
#!/usr/bin/env python
# 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/LICENSE-2.0
#
# ... | lerobot/tests/motors/test_dynamixel.py/0 | {
"file_path": "lerobot/tests/motors/test_dynamixel.py",
"repo_id": "lerobot",
"token_count": 6353
} | 220 |
#!/usr/bin/env python
# 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/LICENSE-2.0
#
# ... | lerobot/tests/rl/test_learner_service.py/0 | {
"file_path": "lerobot/tests/rl/test_learner_service.py",
"repo_id": "lerobot",
"token_count": 4498
} | 221 |
# Model arguments
model_name_or_path: open-r1/R1-Distill-Qwen-Math-7B
model_revision: v03.00-step-000008190
torch_dtype: bfloat16
attn_implementation: flash_attention_2
# Data training arguments
# We edit the DeepSeek chat template to ensure (a) the reasoning block within <think> and </think> is included in the comple... | open-r1/recipes/dataset_filtering/filter_dapo.yaml/0 | {
"file_path": "open-r1/recipes/dataset_filtering/filter_dapo.yaml",
"repo_id": "open-r1",
"token_count": 317
} | 222 |
#!/bin/bash
#SBATCH --job-name=open-r1-compute-pass-rate
#SBATCH --partition=hopper-prod
#SBATCH --qos=normal
#SBATCH --nodes=1
#SBATCH --gpus-per-node=1
#SBATCH --output=./logs/%x-%j.out
#SBATCH --error=./logs/%x-%j.err
#SBATCH --time=01-00:00:00
#SBATCH --requeue
# example usage: sbatch slurm/dataset_filter.slurm r... | open-r1/slurm/compute_pass_rate.slurm/0 | {
"file_path": "open-r1/slurm/compute_pass_rate.slurm",
"repo_id": "open-r1",
"token_count": 231
} | 223 |
# coding=utf-8
# Copyright 2025 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... | open-r1/src/open_r1/rewards.py/0 | {
"file_path": "open-r1/src/open_r1/rewards.py",
"repo_id": "open-r1",
"token_count": 11469
} | 224 |
# Builds GPU docker image of PyTorch
# Uses multi-staged approach to reduce size
# Stage 1
# Use base conda image to reduce time
FROM continuumio/miniconda3:latest AS compile-image
# Specify py version
ENV PYTHON_VERSION=3.11
# Install apt libs - copied from https://github.com/huggingface/accelerate/blob/main/docker/ac... | peft/docker/peft-gpu/Dockerfile/0 | {
"file_path": "peft/docker/peft-gpu/Dockerfile",
"repo_id": "peft",
"token_count": 1015
} | 225 |
<!--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/developer_guides/mixed_models.md/0 | {
"file_path": "peft/docs/source/developer_guides/mixed_models.md",
"repo_id": "peft",
"token_count": 770
} | 226 |
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
# Helper methods
A collection of helper functions for PEFT.
## Checking if a model is a PEFT model
[[autodoc]] helpers.check_if_peft_model
- a... | peft/docs/source/package_reference/helpers.md/0 | {
"file_path": "peft/docs/source/package_reference/helpers.md",
"repo_id": "peft",
"token_count": 180
} | 227 |
<!--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/tutorial/peft_model_config.md/0 | {
"file_path": "peft/docs/source/tutorial/peft_model_config.md",
"repo_id": "peft",
"token_count": 2576
} | 228 |
# 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 applicabl... | peft/examples/boft_controlnet/utils/unet_2d_condition.py/0 | {
"file_path": "peft/examples/boft_controlnet/utils/unet_2d_condition.py",
"repo_id": "peft",
"token_count": 5899
} | 229 |
import gc
import os
import sys
import threading
import psutil
import torch
from accelerate import Accelerator
from datasets import load_dataset
from torch.utils.data import DataLoader
from tqdm import tqdm
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
default_data_collator,
get_linear... | peft/examples/causal_language_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py/0 | {
"file_path": "peft/examples/causal_language_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py",
"repo_id": "peft",
"token_count": 7268
} | 230 |
# 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/examples/feature_extraction/peft_lora_embedding_semantic_search.py/0 | {
"file_path": "peft/examples/feature_extraction/peft_lora_embedding_semantic_search.py",
"repo_id": "peft",
"token_count": 8756
} | 231 |
<jupyter_start><jupyter_text>Using PEFT with timm `peft` allows us to train any model with LoRA as long as the layer type is supported. Since `Conv2D` is one of the supported layer types, it makes sense to test it on image models.In this short notebook, we will demonstrate this with an image classification task using [... | peft/examples/image_classification/image_classification_timm_peft_lora.ipynb/0 | {
"file_path": "peft/examples/image_classification/image_classification_timm_peft_lora.ipynb",
"repo_id": "peft",
"token_count": 3079
} | 232 |
<jupyter_start><jupyter_code>import argparse
import gc
import hashlib
import itertools
import logging
import math
import os
import threading
import warnings
from pathlib import Path
from typing import Optional
import psutil
import json
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from tor... | peft/examples/lora_dreambooth/lora_dreambooth_inference.ipynb/0 | {
"file_path": "peft/examples/lora_dreambooth/lora_dreambooth_inference.ipynb",
"repo_id": "peft",
"token_count": 2331
} | 233 |
# PiSSA: Principal Singular values and Singular vectors Adaptation
## Introduction ([Paper](https://huggingface.co/papers/2404.02948), [code](https://github.com/GraphPKU/PiSSA))
PiSSA represents a matrix $W\in\mathbb{R}^{m\times n}$ within the model by the product of two trainable matrices $A \in \mathbb{R}^{m\times r}... | peft/examples/pissa_finetuning/README.md/0 | {
"file_path": "peft/examples/pissa_finetuning/README.md",
"repo_id": "peft",
"token_count": 2179
} | 234 |
<jupyter_start><jupyter_text>PyTorch AO (torchao) with int8_dynamic_activation_int8_weight Imports<jupyter_code>import argparse
import os
import torch
from torch.optim import AdamW
from torch.utils.data import DataLoader
from peft import (
get_peft_config,
get_peft_model,
get_peft_model_state_dict,
se... | peft/examples/sequence_classification/LoRA-torchao-8bit-dynamic-activation.ipynb/0 | {
"file_path": "peft/examples/sequence_classification/LoRA-torchao-8bit-dynamic-activation.ipynb",
"repo_id": "peft",
"token_count": 1800
} | 235 |
{
"auto_mapping": null,
"base_model_name_or_path": null,
"bias": "none",
"exclude_modules": null,
"fan_in_fan_out": false,
"inference_mode": false,
"init_logits_std": 0.1,
"init_vector_bank_bound": 0.02,
"layers_pattern": null,
"layers_to_transform": null,
"modules_to_save": null,
"num_vectors":... | peft/method_comparison/MetaMathQA/experiments/vblora/llama-3.2-3B-default/adapter_config.json/0 | {
"file_path": "peft/method_comparison/MetaMathQA/experiments/vblora/llama-3.2-3B-default/adapter_config.json",
"repo_id": "peft",
"token_count": 255
} | 236 |
{
"model_id": "meta-llama/Llama-3.2-3B",
"dtype": "float16",
"seed": 42,
"num_inference_runs": 10,
"max_new_tokens": 20,
"category_generation_params": {
"short": {"max_new_tokens": 20},
"medium": {"max_new_tokens": 50},
"long": {"max_new_tokens": 100}
}
}
| peft/method_comparison/text_generation_benchmark/default_benchmark_params.json/0 | {
"file_path": "peft/method_comparison/text_generation_benchmark/default_benchmark_params.json",
"repo_id": "peft",
"token_count": 163
} | 237 |
# 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/__init__.py/0 | {
"file_path": "peft/src/peft/__init__.py",
"repo_id": "peft",
"token_count": 2453
} | 238 |
# 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/adalora/bnb.py/0 | {
"file_path": "peft/src/peft/tuners/adalora/bnb.py",
"repo_id": "peft",
"token_count": 2655
} | 239 |
# Copyright 2024-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/fourierft/model.py/0 | {
"file_path": "peft/src/peft/tuners/fourierft/model.py",
"repo_id": "peft",
"token_count": 6288
} | 240 |
# 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/layer.py/0 | {
"file_path": "peft/src/peft/tuners/loha/layer.py",
"repo_id": "peft",
"token_count": 7383
} | 241 |
# Copyright 2024-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/hqq.py/0 | {
"file_path": "peft/src/peft/tuners/lora/hqq.py",
"repo_id": "peft",
"token_count": 5205
} | 242 |
# 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/multitask_prompt_tuning/model.py/0 | {
"file_path": "peft/src/peft/tuners/multitask_prompt_tuning/model.py",
"repo_id": "peft",
"token_count": 2252
} | 243 |
# 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/poly/config.py/0 | {
"file_path": "peft/src/peft/tuners/poly/config.py",
"repo_id": "peft",
"token_count": 1683
} | 244 |
# Copyright 2025-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/road/bnb.py/0 | {
"file_path": "peft/src/peft/tuners/road/bnb.py",
"repo_id": "peft",
"token_count": 9372
} | 245 |
# Copyright 2024-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/vblora/layer.py/0 | {
"file_path": "peft/src/peft/tuners/vblora/layer.py",
"repo_id": "peft",
"token_count": 4998
} | 246 |
# 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/utils/integrations.py/0 | {
"file_path": "peft/src/peft/utils/integrations.py",
"repo_id": "peft",
"token_count": 4048
} | 247 |
# 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/tests/test_common_gpu.py/0 | {
"file_path": "peft/tests/test_common_gpu.py",
"repo_id": "peft",
"token_count": 42326
} | 248 |
# Copyright 2025-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/tests/test_lorafa.py/0 | {
"file_path": "peft/tests/test_lorafa.py",
"repo_id": "peft",
"token_count": 2001
} | 249 |
# Copyright 2024-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/tests/test_vblora.py/0 | {
"file_path": "peft/tests/test_vblora.py",
"repo_id": "peft",
"token_count": 5031
} | 250 |
# timm
<img class="float-left !m-0 !border-0 !dark:border-0 !shadow-none !max-w-lg w-[150px]" src="https://huggingface.co/front/thumbnails/docs/timm.png"/>
`timm` is a library containing SOTA computer vision models, layers, utilities, optimizers, schedulers, data-loaders, augmentations, and training/evaluation script... | pytorch-image-models/hfdocs/source/index.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/index.mdx",
"repo_id": "pytorch-image-models",
"token_count": 560
} | 251 |
# ESE-VoVNet
**VoVNet** is a convolutional neural network that seeks to make [DenseNet](https://paperswithcode.com/method/densenet) more efficient by concatenating all features only once in the last feature map, which makes input size constant and enables enlarging new output channel.
Read about [one-shot aggregatio... | pytorch-image-models/hfdocs/source/models/ese-vovnet.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/ese-vovnet.mdx",
"repo_id": "pytorch-image-models",
"token_count": 1954
} | 252 |
# MixNet
**MixNet** is a type of convolutional neural network discovered via AutoML that utilises [MixConvs](https://paperswithcode.com/method/mixconv) instead of regular [depthwise convolutions](https://paperswithcode.com/method/depthwise-convolution).
## How do I use this model on an image?
To load a pretrained mo... | pytorch-image-models/hfdocs/source/models/mixnet.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/mixnet.mdx",
"repo_id": "pytorch-image-models",
"token_count": 2687
} | 253 |
# Wide ResNet
**Wide Residual Networks** are a variant on [ResNets](https://paperswithcode.com/method/resnet) where we decrease depth and increase the width of residual networks. This is achieved through the use of [wide residual blocks](https://paperswithcode.com/method/wide-residual-block).
## How do I use this mod... | pytorch-image-models/hfdocs/source/models/wide-resnet.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/wide-resnet.mdx",
"repo_id": "pytorch-image-models",
"token_count": 2038
} | 254 |
# Validation and Benchmark Results
This folder contains validation and benchmark results for the models in this collection. Validation scores are currently only run for models with pretrained weights and ImageNet-1k heads, benchmark numbers are run for all.
## Datasets
There are currently results for the ImageNet va... | pytorch-image-models/results/README.md/0 | {
"file_path": "pytorch-image-models/results/README.md",
"repo_id": "pytorch-image-models",
"token_count": 1173
} | 255 |
from .auto_augment import RandAugment, AutoAugment, rand_augment_ops, auto_augment_policy,\
rand_augment_transform, auto_augment_transform
from .config import resolve_data_config, resolve_model_data_config
from .constants import *
from .dataset import ImageDataset, IterableImageDataset, AugMixDataset
from .dataset_... | pytorch-image-models/timm/data/__init__.py/0 | {
"file_path": "pytorch-image-models/timm/data/__init__.py",
"repo_id": "pytorch-image-models",
"token_count": 420
} | 256 |
""" Dynamic Sequence Length Datasets for Variable Resolution Image Processing
Implements two dataset wrappers:
1. NaFlexMapDatasetWrapper - Map-style dataset that returns batches with variable sequence lengths
TODO: 2. NaFlexIterableDatasetWrapper - Iterable dataset that yields batches with variable sequence lengths
... | pytorch-image-models/timm/data/naflex_dataset.py/0 | {
"file_path": "pytorch-image-models/timm/data/naflex_dataset.py",
"repo_id": "pytorch-image-models",
"token_count": 10494
} | 257 |
""" Dataset reader that wraps TFDS datasets
Wraps many (most?) TFDS image-classification datasets
from https://github.com/tensorflow/datasets
https://www.tensorflow.org/datasets/catalog/overview#image_classification
Hacked together by / Copyright 2020 Ross Wightman
"""
import math
import os
import sys
from typing imp... | pytorch-image-models/timm/data/readers/reader_tfds.py/0 | {
"file_path": "pytorch-image-models/timm/data/readers/reader_tfds.py",
"repo_id": "pytorch-image-models",
"token_count": 7089
} | 258 |
"""
BlurPool layer inspired by
- Kornia's Max_BlurPool2d
- Making Convolutional Networks Shift-Invariant Again :cite:`zhang2019shiftinvar`
Hacked together by Chris Ha and Ross Wightman
"""
from functools import partial
from math import comb # Python 3.8
from typing import Optional, Type
import torch
import torch.n... | pytorch-image-models/timm/layers/blur_pool.py/0 | {
"file_path": "pytorch-image-models/timm/layers/blur_pool.py",
"repo_id": "pytorch-image-models",
"token_count": 1447
} | 259 |
""" 'Fast' Normalization Functions
For GroupNorm and LayerNorm these functions bypass typical AMP upcast to float32.
Additionally, for LayerNorm, the APEX fused LN is used if available (which also does not upcast)
Hacked together by / Copyright 2022 Ross Wightman
"""
from typing import List, Optional
import torch
f... | pytorch-image-models/timm/layers/fast_norm.py/0 | {
"file_path": "pytorch-image-models/timm/layers/fast_norm.py",
"repo_id": "pytorch-image-models",
"token_count": 3526
} | 260 |
""" PyTorch Mixed Convolution
Paper: MixConv: Mixed Depthwise Convolutional Kernels (https://arxiv.org/abs/1907.09595)
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
from torch import nn as nn
from .conv2d_same import create_conv2d_pad
def _split_channels(num_chan, num_groups):
split = [nu... | pytorch-image-models/timm/layers/mixed_conv2d.py/0 | {
"file_path": "pytorch-image-models/timm/layers/mixed_conv2d.py",
"repo_id": "pytorch-image-models",
"token_count": 834
} | 261 |
import torch
import torch.nn as nn
class SpaceToDepth(nn.Module):
bs: torch.jit.Final[int]
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
def forward(self, x):
N, C, H, W = x.size()
x = x.view(N, C, H // self.bs, s... | pytorch-image-models/timm/layers/space_to_depth.py/0 | {
"file_path": "pytorch-image-models/timm/layers/space_to_depth.py",
"repo_id": "pytorch-image-models",
"token_count": 568
} | 262 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.