text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
import argparse
import sys
sys.path.append(".")
from base_classes import TextToImageBenchmark, TurboTextToImageBenchmark # noqa: E402
ALL_T2I_CKPTS = [
"runwayml/stable-diffusion-v1-5",
"segmind/SSD-1B",
"stabilityai/stable-diffusion-xl-base-1.0",
"kandinsky-community/kandinsky-2-2-decoder",
"w... | diffusers/benchmarks/benchmark_text_to_image.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_text_to_image.py",
"repo_id": "diffusers",
"token_count": 480
} | 99 |
- sections:
- local: index
title: 🧨 Diffusers
- local: quicktour
title: Quicktour
- local: stable_diffusion
title: Effective and efficient diffusion
- local: installation
title: Installation
title: Get started
- sections:
- local: tutorials/tutorial_overview
title: Overview
- local: u... | diffusers/docs/source/en/_toctree.yml/0 | {
"file_path": "diffusers/docs/source/en/_toctree.yml",
"repo_id": "diffusers",
"token_count": 7363
} | 100 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/models/autoencoder_oobleck.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoder_oobleck.md",
"repo_id": "diffusers",
"token_count": 565
} | 101 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/models/overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/overview.md",
"repo_id": "diffusers",
"token_count": 336
} | 102 |
<!--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/outputs.md/0 | {
"file_path": "diffusers/docs/source/en/api/outputs.md",
"repo_id": "diffusers",
"token_count": 554
} | 103 |
<!--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... | diffusers/docs/source/en/api/pipelines/controlnetxs.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/controlnetxs.md",
"repo_id": "diffusers",
"token_count": 787
} | 104 |
<!--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": 594
} | 105 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/ddim_inverse.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ddim_inverse.md",
"repo_id": "diffusers",
"token_count": 284
} | 106 |
<!--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/conceptual/ethical_guidelines.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/ethical_guidelines.md",
"repo_id": "diffusers",
"token_count": 1155
} | 107 |
<!--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/tome.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/tome.md",
"repo_id": "diffusers",
"token_count": 3379
} | 108 |
<!--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/training/overview.md/0 | {
"file_path": "diffusers/docs/source/en/training/overview.md",
"repo_id": "diffusers",
"token_count": 1545
} | 109 |
<!--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/controlnet.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/controlnet.md",
"repo_id": "diffusers",
"token_count": 8639
} | 110 |
<!--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/overview_techniques.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/overview_techniques.md",
"repo_id": "diffusers",
"token_count": 243
} | 111 |
<!--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/write_own_pipeline.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/write_own_pipeline.md",
"repo_id": "diffusers",
"token_count": 4145
} | 112 |
<!--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/installation.md/0 | {
"file_path": "diffusers/docs/source/ko/installation.md",
"repo_id": "diffusers",
"token_count": 3689
} | 113 |
# 여러 GPU를 사용한 분산 추론
분산 설정에서는 여러 개의 프롬프트를 동시에 생성할 때 유용한 🤗 [Accelerate](https://huggingface.co/docs/accelerate/index) 또는 [PyTorch Distributed](https://pytorch.org/tutorials/beginner/dist_overview.html)를 사용하여 여러 GPU에서 추론을 실행할 수 있습니다.
이 가이드에서는 분산 추론을 위해 🤗 Accelerate와 PyTorch Distributed를 사용하는 방법을 보여드립니다.
## 🤗 Acceler... | diffusers/docs/source/ko/training/distributed_inference.md/0 | {
"file_path": "diffusers/docs/source/ko/training/distributed_inference.md",
"repo_id": "diffusers",
"token_count": 2604
} | 114 |
<!--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/inpaint.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/inpaint.md",
"repo_id": "diffusers",
"token_count": 1656
} | 115 |
<!--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/pt/index.md/0 | {
"file_path": "diffusers/docs/source/pt/index.md",
"repo_id": "diffusers",
"token_count": 1653
} | 116 |
# Community Scripts
**Community scripts** consist of inference examples using Diffusers pipelines that have been added by the community.
Please have a look at the following table to get an overview of all community examples. Click on the **Code Example** to get a copy-and-paste code example that you can try out.
If a ... | diffusers/examples/community/README_community_scripts.md/0 | {
"file_path": "diffusers/examples/community/README_community_scripts.md",
"repo_id": "diffusers",
"token_count": 5642
} | 117 |
# Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import AutoencoderKL, Co... | diffusers/examples/community/stable_diffusion_controlnet_img2img.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_controlnet_img2img.py",
"repo_id": "diffusers",
"token_count": 19369
} | 118 |
import inspect
from typing import List, Optional, Tuple, Union
import torch
from torch.nn import functional as F
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers import (
DiffusionPipeline,
ImagePipelineOu... | diffusers/examples/community/unclip_text_interpolation.py/0 | {
"file_path": "diffusers/examples/community/unclip_text_interpolation.py",
"repo_id": "diffusers",
"token_count": 10699
} | 119 |
# from accelerate.utils import write_basic_config
#
# write_basic_config()
import argparse
import logging
import math
import os
import shutil
from pathlib import Path
import accelerate
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
import transformers
from accelerate import Accelerator
from... | diffusers/examples/research_projects/gligen/train_gligen_text.py/0 | {
"file_path": "diffusers/examples/research_projects/gligen/train_gligen_text.py",
"repo_id": "diffusers",
"token_count": 13024
} | 120 |
# Scheduled Pseudo-Huber Loss for Diffusers
These are the modifications of to include the possibility of training text2image models with Scheduled Pseudo Huber loss, introduced in https://arxiv.org/abs/2403.16728. (https://github.com/kabachuha/SPHL-for-stable-diffusion)
## Why this might be useful?
- If you suspect ... | diffusers/examples/research_projects/scheduled_huber_loss_training/README.md/0 | {
"file_path": "diffusers/examples/research_projects/scheduled_huber_loss_training/README.md",
"repo_id": "diffusers",
"token_count": 217
} | 121 |
#!/usr/bin/env python
# coding=utf-8
# 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/LI... | diffusers/examples/research_projects/vae/vae_roundtrip.py/0 | {
"file_path": "diffusers/examples/research_projects/vae/vae_roundtrip.py",
"repo_id": "diffusers",
"token_count": 3616
} | 122 |
## Training an VQGAN VAE
VQVAEs were first introduced in [Neural Discrete Representation Learning](https://arxiv.org/abs/1711.00937) and was combined with a GAN in the paper [Taming Transformers for High-Resolution Image Synthesis](https://arxiv.org/abs/2012.09841). The basic idea of a VQVAE is it's a type of a variati... | diffusers/examples/vqgan/README.md/0 | {
"file_path": "diffusers/examples/vqgan/README.md",
"repo_id": "diffusers",
"token_count": 1948
} | 123 |
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
} | 124 |
import argparse
import re
import torch
import yaml
from transformers import (
CLIPProcessor,
CLIPTextModel,
CLIPTokenizer,
CLIPVisionModelWithProjection,
)
from diffusers import (
AutoencoderKL,
DDIMScheduler,
StableDiffusionGLIGENPipeline,
StableDiffusionGLIGENTextImagePipeline,
U... | diffusers/scripts/convert_gligen_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_gligen_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 11150
} | 125 |
# coding=utf-8
# Copyright 2024 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/scripts/convert_original_audioldm2_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_original_audioldm2_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 21165
} | 126 |
from diffusers.utils import is_accelerate_available, logging
if is_accelerate_available():
pass
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
def create_unet_diffusers_config(original_config, image_size: int, controlnet=False):
"""
Creates a config for the diffusers based on the... | diffusers/scripts/convert_svd_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_svd_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 14781
} | 127 |
# 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/commands/env.py/0 | {
"file_path": "diffusers/src/diffusers/commands/env.py",
"repo_id": "diffusers",
"token_count": 2858
} | 128 |
# 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/single_file.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/single_file.py",
"repo_id": "diffusers",
"token_count": 10776
} | 129 |
# 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": 9536
} | 130 |
# 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/embeddings.py/0 | {
"file_path": "diffusers/src/diffusers/models/embeddings.py",
"repo_id": "diffusers",
"token_count": 29839
} | 131 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/transformers/dual_transformer_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/dual_transformer_2d.py",
"repo_id": "diffusers",
"token_count": 3174
} | 132 |
# 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_2d_blocks.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_2d_blocks.py",
"repo_id": "diffusers",
"token_count": 77921
} | 133 |
# 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/audioldm2/modeling_audioldm2.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/audioldm2/modeling_audioldm2.py",
"repo_id": "diffusers",
"token_count": 34160
} | 134 |
from typing import TYPE_CHECKING
from ...utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_dance_diffusion": ["DanceDiffusionPipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_dance_diffusion import DanceDiffusionPipeline
else:
import sys
sys.modules[__na... | diffusers/src/diffusers/pipelines/dance_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/dance_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 189
} | 135 |
from typing import List
import PIL.Image
import torch
from PIL import Image
from ...configuration_utils import ConfigMixin
from ...models.modeling_utils import ModelMixin
from ...utils import PIL_INTERPOLATION
class IFWatermarker(ModelMixin, ConfigMixin):
def __init__(self):
super().__init__()
... | diffusers/src/diffusers/pipelines/deepfloyd_if/watermark.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/watermark.py",
"repo_id": "diffusers",
"token_count": 737
} | 136 |
# Copyright 2024 ETH Zurich Computer Vision Lab 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... | diffusers/src/diffusers/pipelines/deprecated/repaint/pipeline_repaint.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/repaint/pipeline_repaint.py",
"repo_id": "diffusers",
"token_count": 4200
} | 137 |
# 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/stochastic_karras_ve/pipeline_stochastic_karras_ve.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/stochastic_karras_ve/pipeline_stochastic_karras_ve.py",
"repo_id": "diffusers",
"token_count": 2264
} | 138 |
# 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/free_noise_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/free_noise_utils.py",
"repo_id": "diffusers",
"token_count": 9204
} | 139 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py",
"repo_id": "diffusers",
"token_count": 7522
} | 140 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/shap_e/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/shap_e/__init__.py",
"repo_id": "diffusers",
"token_count": 939
} | 141 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py",
"repo_id": "diffusers",
"token_count": 19797
} | 142 |
# Copyright 2024 The GLIGEN Authors and HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | diffusers/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py",
"repo_id": "diffusers",
"token_count": 22795
} | 143 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
from ...utils import BaseOutput, is_flax_available
@dataclass
class StableDiffusionXLPipelineOutput(BaseOutput):
"""
Output class for Stable Diffusion pipelines.
Args:
images (`List[PIL.Image.Im... | diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 401
} | 144 |
import copy
import inspect
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL
import torch
import torch.nn.functional as F
from torch.nn.functional import grid_sample
from transformers import (
CLIPImageProcessor,
CLIPTextModel,
... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero_sdxl.py",
"repo_id": "diffusers",
"token_count": 28420
} | 145 |
# 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_prior.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_prior.py",
"repo_id": "diffusers",
"token_count": 10658
} | 146 |
# Copyright 2024 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_euler_discrete.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py",
"repo_id": "diffusers",
"token_count": 5179
} | 147 |
# Copyright 2024 Stanford University Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | diffusers/src/diffusers/schedulers/scheduling_tcd.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_tcd.py",
"repo_id": "diffusers",
"token_count": 14779
} | 148 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class AsymmetricAutoencoderKL(metaclass=DummyObject):
_backends = ["torch"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])
@classmethod
def ... | diffusers/src/diffusers/utils/dummy_pt_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_pt_objects.py",
"repo_id": "diffusers",
"token_count": 16889
} | 149 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/utils/outputs.py/0 | {
"file_path": "diffusers/src/diffusers/utils/outputs.py",
"repo_id": "diffusers",
"token_count": 2035
} | 150 |
# 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/lora/test_lora_layers_sdxl.py/0 | {
"file_path": "diffusers/tests/lora/test_lora_layers_sdxl.py",
"repo_id": "diffusers",
"token_count": 11496
} | 151 |
# 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": 1045
} | 152 |
# 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_spatiotemporal.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_spatiotemporal.py",
"repo_id": "diffusers",
"token_count": 4309
} | 153 |
# 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/amused/test_amused.py/0 | {
"file_path": "diffusers/tests/pipelines/amused/test_amused.py",
"repo_id": "diffusers",
"token_count": 3130
} | 154 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/deepfloyd_if/test_if_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if_img2img.py",
"repo_id": "diffusers",
"token_count": 2077
} | 155 |
# 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/pag/test_pag_sdxl_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_sdxl_img2img.py",
"repo_id": "diffusers",
"token_count": 5816
} | 156 |
# 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/pipelines/shap_e/test_shap_e.py/0 | {
"file_path": "diffusers/tests/pipelines/shap_e/test_shap_e.py",
"repo_id": "diffusers",
"token_count": 3799
} | 157 |
# 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_stable_diffusion_instruction_pix2pix.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion_instruction_pix2pix.py",
"repo_id": "diffusers",
"token_count": 7782
} | 158 |
# 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/test_pipelines_auto.py/0 | {
"file_path": "diffusers/tests/pipelines/test_pipelines_auto.py",
"repo_id": "diffusers",
"token_count": 11447
} | 159 |
# 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/wuerstchen/test_wuerstchen_combined.py/0 | {
"file_path": "diffusers/tests/pipelines/wuerstchen/test_wuerstchen_combined.py",
"repo_id": "diffusers",
"token_count": 3538
} | 160 |
import inspect
import tempfile
import unittest
from typing import Dict, List, Tuple
import torch
from diffusers import EDMEulerScheduler
from .test_schedulers import SchedulerCommonTest
class EDMEulerSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EDMEulerScheduler,)
forward_default_kwargs = (("nu... | diffusers/tests/schedulers/test_scheduler_edm_euler.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_edm_euler.py",
"repo_id": "diffusers",
"token_count": 3799
} | 161 |
import torch
import torch.nn.functional as F
from diffusers import VQDiffusionScheduler
from .test_schedulers import SchedulerCommonTest
class VQDiffusionSchedulerTest(SchedulerCommonTest):
scheduler_classes = (VQDiffusionScheduler,)
def get_scheduler_config(self, **kwargs):
config = {
... | diffusers/tests/schedulers/test_scheduler_vq_diffusion.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_vq_diffusion.py",
"repo_id": "diffusers",
"token_count": 694
} | 162 |
# 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
} | 163 |
# How to contribute to 🤗 LeRobot?
Everyone is welcome to contribute, and we value everybody's contribution. Code
is thus not the only way to help the community. Answering questions, helping
others, reaching out and improving the documentations are immensely valuable to
the community.
It also helps us if you spread t... | lerobot/CONTRIBUTING.md/0 | {
"file_path": "lerobot/CONTRIBUTING.md",
"repo_id": "lerobot",
"token_count": 3143
} | 164 |
# Getting Started with Real-World Robots
This tutorial will guide you through the process of setting up and training a neural network to autonomously control a real robot.
**What You'll Learn:**
1. How to order and assemble your robot.
2. How to connect, configure, and calibrate your robot.
3. How to record and visua... | lerobot/examples/7_get_started_with_real_robot.md/0 | {
"file_path": "lerobot/examples/7_get_started_with_real_robot.md",
"repo_id": "lerobot",
"token_count": 15608
} | 165 |
#!/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/pusht_zarr_format.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/pusht_zarr_format.py",
"repo_id": "lerobot",
"token_count": 4650
} | 166 |
#!/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/policies/normalize.py/0 | {
"file_path": "lerobot/lerobot/common/policies/normalize.py",
"repo_id": "lerobot",
"token_count": 4520
} | 167 |
#!/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
} | 168 |
# @package _global_
seed: 1
dataset_repo_id: lerobot/xarm_lift_medium
training:
offline_steps: 50000
num_workers: 4
batch_size: 256
grad_clip_norm: 10.0
lr: 3e-4
eval_freq: 5000
log_freq: 100
online_steps: 50000
online_rollout_n_episodes: 1
online_rollout_batch_size: 1
# Note: in FOWM `onlin... | lerobot/lerobot/configs/policy/tdmpc.yaml/0 | {
"file_path": "lerobot/lerobot/configs/policy/tdmpc.yaml",
"repo_id": "lerobot",
"token_count": 877
} | 169 |
version https://git-lfs.github.com/spec/v1
oid sha256:7009b3d2f14d6af497eeb32a52332e79cb9c07db24a6c2bbfbeffbaa8151dd69
size 592448
| lerobot/tests/data/lerobot/aloha_mobile_cabinet/train/data-00000-of-00001.arrow/0 | {
"file_path": "lerobot/tests/data/lerobot/aloha_mobile_cabinet/train/data-00000-of-00001.arrow",
"repo_id": "lerobot",
"token_count": 68
} | 170 |
version https://git-lfs.github.com/spec/v1
oid sha256:35b4cf253f3b1342ae6cc151554b12e674e34631e1337e3ba8c0cadedda9ef34
size 247
| lerobot/tests/data/lerobot/aloha_static_coffee/train/state.json/0 | {
"file_path": "lerobot/tests/data/lerobot/aloha_static_coffee/train/state.json",
"repo_id": "lerobot",
"token_count": 64
} | 171 |
version https://git-lfs.github.com/spec/v1
oid sha256:abc5e8f3d5baa0fa439e0804c1c6486881864847712e533336a162c0fff37184
size 247
| lerobot/tests/data/lerobot/aloha_static_thread_velcro/train/state.json/0 | {
"file_path": "lerobot/tests/data/lerobot/aloha_static_thread_velcro/train/state.json",
"repo_id": "lerobot",
"token_count": 62
} | 172 |
version https://git-lfs.github.com/spec/v1
oid sha256:8552d4ac6b618a5b2741e174d51f1d4fc0e5f4e6cc7026bebdb6ed145373b042
size 18320
| lerobot/tests/data/lerobot/pusht/train/data-00000-of-00001.arrow/0 | {
"file_path": "lerobot/tests/data/lerobot/pusht/train/data-00000-of-00001.arrow",
"repo_id": "lerobot",
"token_count": 69
} | 173 |
version https://git-lfs.github.com/spec/v1
oid sha256:c06131233f3f66f8330b7923ae0faaf2fe1c52c1d6b8d61729b6c85ade262ca3
size 2808
| lerobot/tests/data/lerobot/xarm_push_medium_replay/meta_data/stats.safetensors/0 | {
"file_path": "lerobot/tests/data/lerobot/xarm_push_medium_replay/meta_data/stats.safetensors",
"repo_id": "lerobot",
"token_count": 68
} | 174 |
version https://git-lfs.github.com/spec/v1
oid sha256:bb65a25e989a32a8b6258d368bd077e4548379c74ab5ada01cc532d658670df0
size 3687117
| lerobot/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_499.safetensors/0 | {
"file_path": "lerobot/tests/data/save_dataset_to_safetensors/lerobot/aloha_sim_insertion_human/frame_499.safetensors",
"repo_id": "lerobot",
"token_count": 65
} | 175 |
version https://git-lfs.github.com/spec/v1
oid sha256:dfbc3b1ad5e3b94311edda0f04db002b26117b0719b73dfdb56dd483dc9c409d
size 31672
| lerobot/tests/data/save_policy_to_safetensors/aloha_act/grad_stats.safetensors/0 | {
"file_path": "lerobot/tests/data/save_policy_to_safetensors/aloha_act/grad_stats.safetensors",
"repo_id": "lerobot",
"token_count": 65
} | 176 |
from pathlib import Path
from lerobot.common.policies.factory import make_policy
from lerobot.common.robot_devices.robots.factory import make_robot
from lerobot.common.utils.utils import init_hydra_config
from lerobot.scripts.control_robot import calibrate, record, replay, teleoperate
from tests.utils import DEFAULT_C... | lerobot/tests/test_control_robot.py/0 | {
"file_path": "lerobot/tests/test_control_robot.py",
"repo_id": "lerobot",
"token_count": 845
} | 177 |
[tool.black]
line-length = 119
target-version = ['py37']
[tool.ruff]
# Never enforce `E501` (line length violations).
ignore = ["C901", "E501", "E741", "W605"]
select = ["C", "E", "F", "I", "W"]
line-length = 119
# Ignore import violations in all `__init__.py` files.
[tool.ruff.per-file-ignores]
"__init__.py" = ["E40... | parler-tts/pyproject.toml/0 | {
"file_path": "parler-tts/pyproject.toml",
"repo_id": "parler-tts",
"token_count": 174
} | 178 |
- title: Get started
sections:
- local: index
title: 🤗 PEFT
- local: quicktour
title: Quicktour
- local: install
title: Installation
- title: Tutorial
sections:
- local: tutorial/peft_model_config
title: Configurations and models
- local: tutorial/peft_integrations
title: Integration... | peft/docs/source/_toctree.yml/0 | {
"file_path": "peft/docs/source/_toctree.yml",
"repo_id": "peft",
"token_count": 1254
} | 179 |
<!--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/troubleshooting.md/0 | {
"file_path": "peft/docs/source/developer_guides/troubleshooting.md",
"repo_id": "peft",
"token_count": 4342
} | 180 |
<!--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/package_reference/merge_utils.md/0 | {
"file_path": "peft/docs/source/package_reference/merge_utils.md",
"repo_id": "peft",
"token_count": 361
} | 181 |
<!--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_integrations.md/0 | {
"file_path": "peft/docs/source/tutorial/peft_integrations.md",
"repo_id": "peft",
"token_count": 2255
} | 182 |
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": 6859
} | 183 |
# PiSSA: Principal Singular values and Singular vectors Adaptation
## Introduction ([Paper](https://arxiv.org/abs/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}$ and $B... | peft/examples/pissa_finetuning/README.md/0 | {
"file_path": "peft/examples/pissa_finetuning/README.md",
"repo_id": "peft",
"token_count": 2158
} | 184 |
# 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/mapping.py/0 | {
"file_path": "peft/src/peft/mapping.py",
"repo_id": "peft",
"token_count": 3150
} | 185 |
# 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/adaption_prompt/layer.py/0 | {
"file_path": "peft/src/peft/tuners/adaption_prompt/layer.py",
"repo_id": "peft",
"token_count": 2468
} | 186 |
# 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/hra/layer.py/0 | {
"file_path": "peft/src/peft/tuners/hra/layer.py",
"repo_id": "peft",
"token_count": 8719
} | 187 |
# 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/router.py/0 | {
"file_path": "peft/src/peft/tuners/poly/router.py",
"repo_id": "peft",
"token_count": 1101
} | 188 |
# 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/xlora/model.py/0 | {
"file_path": "peft/src/peft/tuners/xlora/model.py",
"repo_id": "peft",
"token_count": 9075
} | 189 |
# 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_config.py/0 | {
"file_path": "peft/tests/test_config.py",
"repo_id": "peft",
"token_count": 5118
} | 190 |
# 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_stablediffusion.py/0 | {
"file_path": "peft/tests/test_stablediffusion.py",
"repo_id": "peft",
"token_count": 5046
} | 191 |
# PyTorch Image Models
- [What's New](#whats-new)
- [Introduction](#introduction)
- [Models](#models)
- [Features](#features)
- [Results](#results)
- [Getting Started (Documentation)](#getting-started-documentation)
- [Train, Validation, Inference Scripts](#train-validation-inference-scripts)
- [Awesome PyTorch Resourc... | pytorch-image-models/README.md/0 | {
"file_path": "pytorch-image-models/README.md",
"repo_id": "pytorch-image-models",
"token_count": 17008
} | 192 |
# Model Summaries
The model architectures included come from a wide variety of sources. Sources, including papers, original impl ("reference code") that I rewrote / adapted, and PyTorch impl that I leveraged directly ("code") are listed below.
Most included models have pretrained weights. The weights are either:
1. ... | pytorch-image-models/hfdocs/source/models.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models.mdx",
"repo_id": "pytorch-image-models",
"token_count": 4494
} | 193 |
# MobileNet v2
**MobileNetV2** is a convolutional neural network architecture that seeks to perform well on mobile devices. It is based on an [inverted residual structure](https://paperswithcode.com/method/inverted-residual-block) where the residual connections are between the bottleneck layers. The intermediate expa... | pytorch-image-models/hfdocs/source/models/mobilenet-v2.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/mobilenet-v2.mdx",
"repo_id": "pytorch-image-models",
"token_count": 3401
} | 194 |
# Quickstart
This quickstart is intended for developers who are ready to dive into the code and see an example of how to integrate `timm` into their model training workflow.
First, you'll need to install `timm`. For more information on installation, see [Installation](installation).
```bash
pip install timm
```
## ... | pytorch-image-models/hfdocs/source/quickstart.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/quickstart.mdx",
"repo_id": "pytorch-image-models",
"token_count": 2583
} | 195 |
from abc import abstractmethod
class Reader:
def __init__(self):
pass
@abstractmethod
def _filename(self, index, basename=False, absolute=False):
pass
def filename(self, index, basename=False, absolute=False):
return self._filename(index, basename=basename, absolute=absolute)... | pytorch-image-models/timm/data/readers/reader.py/0 | {
"file_path": "pytorch-image-models/timm/data/readers/reader.py",
"repo_id": "pytorch-image-models",
"token_count": 171
} | 196 |
""" Activations (memory-efficient w/ custom autograd)
A collection of activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
These activations are not compatible with jit scripting or ONNX export of the model, please use
basic versions of the... | pytorch-image-models/timm/layers/activations_me.py/0 | {
"file_path": "pytorch-image-models/timm/layers/activations_me.py",
"repo_id": "pytorch-image-models",
"token_count": 2424
} | 197 |
""" Norm Layer Factory
Create norm modules by string (to mirror create_act and creat_norm-act fns)
Copyright 2022 Ross Wightman
"""
import functools
import types
from typing import Type
import torch.nn as nn
from .norm import GroupNorm, GroupNorm1, LayerNorm, LayerNorm2d, RmsNorm
from torchvision.ops.misc import Fr... | pytorch-image-models/timm/layers/create_norm.py/0 | {
"file_path": "pytorch-image-models/timm/layers/create_norm.py",
"repo_id": "pytorch-image-models",
"token_count": 632
} | 198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.