text stringlengths 7 328k | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 459 |
|---|---|---|---|
<!--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/fp16.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/fp16.md",
"repo_id": "diffusers",
"token_count": 1046
} | 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/training/ddpo.md/0 | {
"file_path": "diffusers/docs/source/en/training/ddpo.md",
"repo_id": "diffusers",
"token_count": 321
} | 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/tutorials/fast_diffusion.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/fast_diffusion.md",
"repo_id": "diffusers",
"token_count": 4863
} | 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/using-diffusers/inference_with_lcm.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/inference_with_lcm.md",
"repo_id": "diffusers",
"token_count": 3677
} | 103 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/schedulers.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/schedulers.md",
"repo_id": "diffusers",
"token_count": 3997
} | 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... | diffusers/docs/source/ja/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/ja/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6241
} | 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/ko/optimization/torch2.0.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/torch2.0.md",
"repo_id": "diffusers",
"token_count": 10790
} | 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 agree... | diffusers/docs/source/ko/tutorials/basic_training.md/0 | {
"file_path": "diffusers/docs/source/ko/tutorials/basic_training.md",
"repo_id": "diffusers",
"token_count": 11285
} | 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/ko/using-diffusers/reusing_seeds.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/reusing_seeds.md",
"repo_id": "diffusers",
"token_count": 1922
} | 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/zh/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/zh/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6188
} | 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 applicabl... | diffusers/examples/community/dps_pipeline.py/0 | {
"file_path": "diffusers/examples/community/dps_pipeline.py",
"repo_id": "diffusers",
"token_count": 11140
} | 110 |
from typing import Union
import torch
from PIL import Image
from torchvision import transforms as tfms
from tqdm.auto import tqdm
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
... | diffusers/examples/community/magic_mix.py/0 | {
"file_path": "diffusers/examples/community/magic_mix.py",
"repo_id": "diffusers",
"token_count": 2446
} | 111 |
# Copyright 2024 Jake Babbidge, TencentARC 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/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py",
"repo_id": "diffusers",
"token_count": 41923
} | 112 |
# Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import PIL.Image
import torch
import torch.nn.functional as F
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers... | diffusers/examples/community/stable_diffusion_controlnet_inpaint_img2img.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_controlnet_inpaint_img2img.py",
"repo_id": "diffusers",
"token_count": 23359
} | 113 |
#!/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/controlnet/train_controlnet.py/0 | {
"file_path": "diffusers/examples/controlnet/train_controlnet.py",
"repo_id": "diffusers",
"token_count": 20469
} | 114 |
#!/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/dreambooth/train_dreambooth.py/0 | {
"file_path": "diffusers/examples/dreambooth/train_dreambooth.py",
"repo_id": "diffusers",
"token_count": 25337
} | 115 |
# 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/LICENSE-2.0
#
# Unless r... | diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.py/0 | {
"file_path": "diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.py",
"repo_id": "diffusers",
"token_count": 14877
} | 116 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/examples/research_projects/controlnetxs/controlnetxs.py/0 | {
"file_path": "diffusers/examples/research_projects/controlnetxs/controlnetxs.py",
"repo_id": "diffusers",
"token_count": 20494
} | 117 |
import argparse
import intel_extension_for_pytorch as ipex
import torch
from diffusers import DPMSolverMultistepScheduler, StableDiffusionPipeline
parser = argparse.ArgumentParser("Stable Diffusion script with intel optimization", add_help=False)
parser.add_argument("--dpm", action="store_true", help="Enable DPMSol... | diffusers/examples/research_projects/intel_opts/inference_bf16.py/0 | {
"file_path": "diffusers/examples/research_projects/intel_opts/inference_bf16.py",
"repo_id": "diffusers",
"token_count": 798
} | 118 |
import argparse
import copy
import itertools
import logging
import math
import os
import random
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils impor... | diffusers/examples/research_projects/multi_subject_dreambooth_inpainting/train_multi_subject_dreambooth_inpainting.py/0 | {
"file_path": "diffusers/examples/research_projects/multi_subject_dreambooth_inpainting/train_multi_subject_dreambooth_inpainting.py",
"repo_id": "diffusers",
"token_count": 10829
} | 119 |
import argparse
import inspect
import logging
import math
import os
from pathlib import Path
import accelerate
import datasets
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration
from datasets import... | diffusers/examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py/0 | {
"file_path": "diffusers/examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py",
"repo_id": "diffusers",
"token_count": 12739
} | 120 |
# T2I-Adapter training example for Stable Diffusion XL (SDXL)
The `train_t2i_adapter_sdxl.py` script shows how to implement the [T2I-Adapter training procedure](https://hf.co/papers/2302.08453) for [Stable Diffusion XL](https://huggingface.co/papers/2307.01952).
## Running locally with PyTorch
### Installing the dep... | diffusers/examples/t2i_adapter/README_sdxl.md/0 | {
"file_path": "diffusers/examples/t2i_adapter/README_sdxl.md",
"repo_id": "diffusers",
"token_count": 1551
} | 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/text_to_image/train_text_to_image_sdxl.py/0 | {
"file_path": "diffusers/examples/text_to_image/train_text_to_image_sdxl.py",
"repo_id": "diffusers",
"token_count": 24853
} | 122 |
import torch.nn as nn
from torchvision.models import efficientnet_v2_l, efficientnet_v2_s
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.models.modeling_utils import ModelMixin
class EfficientNetEncoder(ModelMixin, ConfigMixin):
@register_to_config
def __init__(self,... | diffusers/examples/wuerstchen/text_to_image/modeling_efficient_net_encoder.py/0 | {
"file_path": "diffusers/examples/wuerstchen/text_to_image/modeling_efficient_net_encoder.py",
"repo_id": "diffusers",
"token_count": 374
} | 123 |
import argparse
import json
import torch
from diffusers import AutoencoderKL, DDPMPipeline, DDPMScheduler, UNet2DModel, VQModel
def shave_segments(path, n_shave_prefix_segments=1):
"""
Removes segments. Positive values shave the first segments, negative shave the last segments.
"""
if n_shave_prefix... | diffusers/scripts/convert_ddpm_original_checkpoint_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_ddpm_original_checkpoint_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 8490
} | 124 |
#!/usr/bin/env python3
import argparse
import os
import jax as jnp
import numpy as onp
import torch
import torch.nn as nn
from music_spectrogram_diffusion import inference
from t5x import checkpoints
from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline
from diffusers.pipelines.spectrogr... | diffusers/scripts/convert_music_spectrogram_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_music_spectrogram_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 4469
} | 125 |
import argparse
import safetensors.torch
from diffusers import AutoencoderTiny
"""
Example - From the diffusers root directory:
Download the weights:
```sh
$ wget -q https://huggingface.co/madebyollin/taesd/resolve/main/taesd_encoder.safetensors
$ wget -q https://huggingface.co/madebyollin/taesd/resolve/main/taesd... | diffusers/scripts/convert_tiny_autoencoder_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_tiny_autoencoder_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 990
} | 126 |
# 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/fp16_safetensors.py/0 | {
"file_path": "diffusers/src/diffusers/commands/fp16_safetensors.py",
"repo_id": "diffusers",
"token_count": 2248
} | 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/loaders/single_file.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/single_file.py",
"repo_id": "diffusers",
"token_count": 5875
} | 128 |
# Copyright 2024 Ollin Boer Bohan 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/models/autoencoders/autoencoder_tiny.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_tiny.py",
"repo_id": "diffusers",
"token_count": 6580
} | 129 |
from ..utils import deprecate
from .transformers.prior_transformer import PriorTransformer, PriorTransformerOutput
class PriorTransformerOutput(PriorTransformerOutput):
deprecation_message = "Importing `PriorTransformerOutput` from `diffusers.models.prior_transformer` is deprecated and this will be removed in a f... | diffusers/src/diffusers/models/prior_transformer.py/0 | {
"file_path": "diffusers/src/diffusers/models/prior_transformer.py",
"repo_id": "diffusers",
"token_count": 235
} | 130 |
# 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/src/diffusers/models/unets/uvit_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/uvit_2d.py",
"repo_id": "diffusers",
"token_count": 8290
} | 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/pipelines/audioldm/pipeline_audioldm.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/audioldm/pipeline_audioldm.py",
"repo_id": "diffusers",
"token_count": 11533
} | 132 |
import html
import inspect
import re
import urllib.parse as ul
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from transformers import CLIPImageProcessor, T5EncoderModel, T5Tokenizer
from ...loaders import LoraLoaderMixin
from ...models import UNet2DCond... | diffusers/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting.py",
"repo_id": "diffusers",
"token_count": 21148
} | 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/deprecated/audio_diffusion/pipeline_audio_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/audio_diffusion/pipeline_audio_diffusion.py",
"repo_id": "diffusers",
"token_count": 6240
} | 134 |
import inspect
from typing import Callable, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTokenizer
from ....configuration_utils import FrozenDict
from ....schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
from ....utils impo... | diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py",
"repo_id": "diffusers",
"token_count": 12042
} | 135 |
# Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
# William Peebles and Saining Xie
#
# Copyright (c) 2021 OpenAI
# MIT License
#
# 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 wi... | diffusers/src/diffusers/pipelines/dit/pipeline_dit.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/dit/pipeline_dit.py",
"repo_id": "diffusers",
"token_count": 4179
} | 136 |
# 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_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py",
"repo_id": "diffusers",
"token_count": 7964
} | 137 |
# 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... | diffusers/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion_xl.py",
"repo_id": "diffusers",
"token_count": 41594
} | 138 |
from dataclasses import dataclass
from typing import List, Optional, Union
import numpy as np
import PIL.Image
from ...utils import BaseOutput
@dataclass
class SemanticStableDiffusionPipelineOutput(BaseOutput):
"""
Output class for Stable Diffusion pipelines.
Args:
images (`List[PIL.Image.Image... | diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 306
} | 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/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py",
"repo_id": "diffusers",
"token_count": 9901
} | 140 |
# 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_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py",
"repo_id": "diffusers",
"token_count": 17229
} | 141 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and i... | diffusers/src/diffusers/pipelines/stable_diffusion_panorama/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_panorama/__init__.py",
"repo_id": "diffusers",
"token_count": 528
} | 142 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
BaseOutput,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_av... | diffusers/src/diffusers/pipelines/stable_video_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_video_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 664
} | 143 |
from typing import Optional
import numpy as np
import torch
from torch import nn
from transformers import GPT2Config, GPT2LMHeadModel
from transformers.modeling_utils import ModuleUtilsMixin
from ...configuration_utils import ConfigMixin, register_to_config
from ...models import ModelMixin
# Modified from ClipCapti... | diffusers/src/diffusers/pipelines/unidiffuser/modeling_text_decoder.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/unidiffuser/modeling_text_decoder.py",
"repo_id": "diffusers",
"token_count": 6304
} | 144 |
# Copyright 2024 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/deprecated/scheduling_sde_vp.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/deprecated/scheduling_sde_vp.py",
"repo_id": "diffusers",
"token_count": 1693
} | 145 |
# Copyright 2024 Katherine Crowson, The HuggingFace Team and hlky. 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_dpmsolver_sde.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py",
"repo_id": "diffusers",
"token_count": 10658
} | 146 |
# Copyright 2024 Zhejiang University Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | diffusers/src/diffusers/schedulers/scheduling_pndm_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_pndm_flax.py",
"repo_id": "diffusers",
"token_count": 9597
} | 147 |
# 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/doc_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/doc_utils.py",
"repo_id": "diffusers",
"token_count": 506
} | 148 |
# 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/import_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/import_utils.py",
"repo_id": "diffusers",
"token_count": 9538
} | 149 |
# 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_sd.py/0 | {
"file_path": "diffusers/tests/lora/test_lora_layers_sd.py",
"repo_id": "diffusers",
"token_count": 10772
} | 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/models/unets/test_models_unet_1d.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_1d.py",
"repo_id": "diffusers",
"token_count": 3985
} | 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/others/test_image_processor.py/0 | {
"file_path": "diffusers/tests/others/test_image_processor.py",
"repo_id": "diffusers",
"token_count": 5494
} | 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/pipelines/ddim/test_ddim.py/0 | {
"file_path": "diffusers/tests/pipelines/ddim/test_ddim.py",
"repo_id": "diffusers",
"token_count": 2227
} | 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/kandinsky/test_kandinsky.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky/test_kandinsky.py",
"repo_id": "diffusers",
"token_count": 4828
} | 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/kandinsky3/test_kandinsky3_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky3/test_kandinsky3_img2img.py",
"repo_id": "diffusers",
"token_count": 3405
} | 155 |
# These are canonical sets of parameters for different types of pipelines.
# They are set on subclasses of `PipelineTesterMixin` as `params` and
# `batch_params`.
#
# If a pipeline's set of arguments has minor changes from one of the common sets
# of arguments, do not make modifications to the existing common sets of a... | diffusers/tests/pipelines/pipeline_params.py/0 | {
"file_path": "diffusers/tests/pipelines/pipeline_params.py",
"repo_id": "diffusers",
"token_count": 1584
} | 156 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py",
"repo_id": "diffusers",
"token_count": 4266
} | 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_2/test_stable_diffusion_upscale.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py",
"repo_id": "diffusers",
"token_count": 9868
} | 158 |
import unittest
from diffusers.pipelines.pipeline_utils import is_safetensors_compatible
class IsSafetensorsCompatibleTests(unittest.TestCase):
def test_all_is_compatible(self):
filenames = [
"safety_checker/pytorch_model.bin",
"safety_checker/model.safetensors",
"vae/... | diffusers/tests/pipelines/test_pipeline_utils.py/0 | {
"file_path": "diffusers/tests/pipelines/test_pipeline_utils.py",
"repo_id": "diffusers",
"token_count": 2746
} | 159 |
import gc
import random
import traceback
import unittest
import numpy as np
import torch
from PIL import Image
from transformers import (
CLIPImageProcessor,
CLIPTextModel,
CLIPTokenizer,
CLIPVisionModelWithProjection,
GPT2Tokenizer,
)
from diffusers import (
AutoencoderKL,
DPMSolverMultis... | diffusers/tests/pipelines/unidiffuser/test_unidiffuser.py/0 | {
"file_path": "diffusers/tests/pipelines/unidiffuser/test_unidiffuser.py",
"repo_id": "diffusers",
"token_count": 14375
} | 160 |
import tempfile
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class DPMSolverSinglestepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (D... | diffusers/tests/schedulers/test_scheduler_dpm_single.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_dpm_single.py",
"repo_id": "diffusers",
"token_count": 6088
} | 161 |
import torch
from diffusers import UnCLIPScheduler
from .test_schedulers import SchedulerCommonTest
# UnCLIPScheduler is a modified DDPMScheduler with a subset of the configuration.
class UnCLIPSchedulerTest(SchedulerCommonTest):
scheduler_classes = (UnCLIPScheduler,)
def get_scheduler_config(self, **kwarg... | diffusers/tests/schedulers/test_scheduler_unclip.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_unclip.py",
"repo_id": "diffusers",
"token_count": 2227
} | 162 |
# 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/utils/overwrite_expected_slice.py/0 | {
"file_path": "diffusers/utils/overwrite_expected_slice.py",
"repo_id": "diffusers",
"token_count": 1258
} | 163 |
# Introduction
<CourseFloatingBanner
unit={0}
classNames="absolute z-10 right-0 top-0"
/>
## Bienvenue au cours sur les modèles de diffusion 🤗 !
## À quoi s'attendre ?
In this free course, you will:
- 👩🎓 Study the theory behind diffusion models
- 🧨 Learn how to generate images and audio with the popula... | diffusion-models-class/units/fr/unit0/1.mdx/0 | {
"file_path": "diffusion-models-class/units/fr/unit0/1.mdx",
"repo_id": "diffusion-models-class",
"token_count": 1801
} | 164 |
<jupyter_start><jupyter_text>Préparer des données (PyTorch) Installez les bibliothèques 🤗 *Transformers* et 🤗 *Datasets* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
import torch
from transformers import AdamW, AutoTokenizer, AutoModelForSequenceClassification
# Comme ... | notebooks/course/fr/chapter3/section2_pt.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter3/section2_pt.ipynb",
"repo_id": "notebooks",
"token_count": 784
} | 165 |
<jupyter_start><jupyter_text>Entraîner un nouveau *tokenizer* à partir d'un ancien Installez les bibliothèques 🤗 *Transformers* et 🤗 *Datasets* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin ... | notebooks/course/fr/chapter6/section2.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter6/section2.ipynb",
"repo_id": "notebooks",
"token_count": 1147
} | 166 |
<jupyter_start><jupyter_text>Résumé (PyTorch) Installez les bibliothèques 🤗 *Datasets* et 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!pip install accelerate
# Pour exécuter l'entraînement sur TPU, vous devez décommenter la ligne suivante :
# !pip insta... | notebooks/course/fr/chapter7/section5_pt.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter7/section5_pt.ipynb",
"repo_id": "notebooks",
"token_count": 4623
} | 167 |
<jupyter_start><jupyter_text>Fonctions avancées d'Interface Installez les bibliothèques 🤗 Transformers et 🤗 Gradio pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!pip install gradio
import random
import gradio as gr
def chat(message, history):
history = history or [... | notebooks/course/fr/chapter9/section6.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter9/section6.ipynb",
"repo_id": "notebooks",
"token_count": 647
} | 168 |
<jupyter_start><jupyter_text>CLIP Guided Stable Diffusion using [d🧨ffusers](https://github.com/huggingface/diffusers) This notebook shows how to do CLIP guidance with Stable diffusion using diffusers libray. This allows you to use newly released [CLIP models by LAION AI.](https://huggingface.co/laion).This notebook is... | notebooks/diffusers/CLIP_Guided_Stable_diffusion_with_diffusers.ipynb/0 | {
"file_path": "notebooks/diffusers/CLIP_Guided_Stable_diffusion_with_diffusers.ipynb",
"repo_id": "notebooks",
"token_count": 9092
} | 169 |
<jupyter_start><jupyter_text>Run Dreambooth fine-tuned models for Stable Diffusion using d🧨ffusers This notebook allows you to run Stable Diffusion concepts trained via Dreambooth using 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffusers). Train your own using [here]() and navigate the [pub... | notebooks/diffusers/sd_dreambooth_inference.ipynb/0 | {
"file_path": "notebooks/diffusers/sd_dreambooth_inference.ipynb",
"repo_id": "notebooks",
"token_count": 1238
} | 170 |
<jupyter_start><jupyter_text>Patch Time Series Transformer in HuggingFace - Getting StartedIn this blog, we provide examples of how to get started with PatchTST. We first demonstrate the forecasting capability of `PatchTST` on the Electricity data. We will then demonstrate the transfer learning capability of `PatchTST`... | notebooks/examples/patch_tst.ipynb/0 | {
"file_path": "notebooks/examples/patch_tst.ipynb",
"repo_id": "notebooks",
"token_count": 7448
} | 171 |
<jupyter_start><jupyter_text>Fine-tuning a 🤗 Transformers model on TPU with **Flax/JAX** In this notebook, we will see how to fine-tune one of the [🤗 Transformers](https://github.com/huggingface/transformers) models on TPU using [**Flax**](https://flax.readthedocs.io/en/latest/index.html). As can be seen on [this ben... | notebooks/examples/text_classification_flax.ipynb/0 | {
"file_path": "notebooks/examples/text_classification_flax.ipynb",
"repo_id": "notebooks",
"token_count": 9221
} | 172 |
<jupyter_start><jupyter_text>Huggingface Sagemaker-sdk - Distributed Training Demo Distributed Summarization with `transformers` scripts + `Trainer` and `samsum` dataset 1. [Tutorial](Tutorial) 2. [Set up a development environment and install sagemaker](Set-up-a-development-environment-and-install-sagemaker) 1. [In... | notebooks/sagemaker/08_distributed_summarization_bart_t5/sagemaker-notebook.ipynb/0 | {
"file_path": "notebooks/sagemaker/08_distributed_summarization_bart_t5/sagemaker-notebook.ipynb",
"repo_id": "notebooks",
"token_count": 5673
} | 173 |
import argparse
import logging
import os
import random
import sys
import numpy as np
import torch
from datasets import load_from_disk, load_metric
from transformers import AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
from transformers.trainer_utils import get_last_checkpoint
if __name... | notebooks/sagemaker/14_train_and_push_to_hub/scripts/train.py/0 | {
"file_path": "notebooks/sagemaker/14_train_and_push_to_hub/scripts/train.py",
"repo_id": "notebooks",
"token_count": 1998
} | 174 |
<jupyter_start><jupyter_text>Serverless Inference with Hugging Face's Transformers & Amazon SageMaker Welcome to this getting started guide. We will use the Hugging Face Inference DLCs and Amazon SageMaker Python SDK to create a [Serverless Inference](https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints... | notebooks/sagemaker/19_serverless_inference/sagemaker-notebook.ipynb/0 | {
"file_path": "notebooks/sagemaker/19_serverless_inference/sagemaker-notebook.ipynb",
"repo_id": "notebooks",
"token_count": 1569
} | 175 |
import base64
import torch
from io import BytesIO
from diffusers import StableDiffusionPipeline
def model_fn(model_dir):
# Load stable diffusion and move it to the GPU
pipe = StableDiffusionPipeline.from_pretrained(model_dir, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
return pipe
def predict_fn(data,... | notebooks/sagemaker/23_stable_diffusion_inference/code/inference.py/0 | {
"file_path": "notebooks/sagemaker/23_stable_diffusion_inference/code/inference.py",
"repo_id": "notebooks",
"token_count": 400
} | 176 |
import os
import argparse
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
set_seed,
default_data_collator,
)
from datasets import load_from_disk
import torch
from transformers import Seq2SeqTrainingArguments, Seq2SeqTrainer, DonutProcessor, VisionEncoderDecoderModel,VisionEncoderDecoderC... | notebooks/sagemaker/26_document_ai_donut/scripts/train.py/0 | {
"file_path": "notebooks/sagemaker/26_document_ai_donut/scripts/train.py",
"repo_id": "notebooks",
"token_count": 1878
} | 177 |
# docstyle-ignore
INSTALL_CONTENT = """
# PEFT installation
! pip install peft accelerate transformers
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/peft.git
"""
| peft/docs/source/_config.py/0 | {
"file_path": "peft/docs/source/_config.py",
"repo_id": "peft",
"token_count": 75
} | 178 |
<!--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/install.md/0 | {
"file_path": "peft/docs/source/install.md",
"repo_id": "peft",
"token_count": 436
} | 179 |
import os
import torch
import torch.nn as nn
import transformers
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import LoraConfig, get_peft_model
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# -*- coding: utf-8 -*-
"""Finetune-opt-bnb-peft.i... | peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py/0 | {
"file_path": "peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py",
"repo_id": "peft",
"token_count": 2325
} | 180 |
import argparse
import os
from typing import Dict
import torch
from diffusers import UNet2DConditionModel
from safetensors.torch import save_file
from transformers import CLIPTextModel
from peft import PeftModel, get_peft_model_state_dict
# Default kohya_ss LoRA replacement modules
# https://github.com/kohya-ss/sd-... | peft/examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py/0 | {
"file_path": "peft/examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py",
"repo_id": "peft",
"token_count": 1639
} | 181 |
<jupyter_start><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,
set_peft_model_state_dict,
PeftType,
PrefixTuningConfig,
PromptEncoderConf... | peft/examples/sequence_classification/P_Tuning.ipynb/0 | {
"file_path": "peft/examples/sequence_classification/P_Tuning.ipynb",
"repo_id": "peft",
"token_count": 2284
} | 182 |
accelerate launch --config_file "configs/deepspeed_config_z3_qlora.yaml" train.py \
--seed 100 \
--model_name_or_path "meta-llama/Llama-2-70b-hf" \
--dataset_name "smangrul/ultrachat-10k-chatml" \
--chat_template_format "chatml" \
--add_special_tokens False \
--append_concat_token False \
--splits "train,test" \
--max... | peft/examples/sft/run_peft_qlora_deepspeed_stage3.sh/0 | {
"file_path": "peft/examples/sft/run_peft_qlora_deepspeed_stage3.sh",
"repo_id": "peft",
"token_count": 510
} | 183 |
# 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/auto.py/0 | {
"file_path": "peft/src/peft/auto.py",
"repo_id": "peft",
"token_count": 2695
} | 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/tuners/adaption_prompt/config.py/0 | {
"file_path": "peft/src/peft/tuners/adaption_prompt/config.py",
"repo_id": "peft",
"token_count": 994
} | 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/lokr/model.py/0 | {
"file_path": "peft/src/peft/tuners/lokr/model.py",
"repo_id": "peft",
"token_count": 1864
} | 186 |
# 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/prompt_tuning/config.py/0 | {
"file_path": "peft/src/peft/tuners/prompt_tuning/config.py",
"repo_id": "peft",
"token_count": 1394
} | 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/tests/test_common_gpu.py/0 | {
"file_path": "peft/tests/test_common_gpu.py",
"repo_id": "peft",
"token_count": 20421
} | 188 |
#!/usr/bin/env python3
# coding=utf-8
# 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
#... | peft/tests/test_tuners_utils.py/0 | {
"file_path": "peft/tests/test_tuners_utils.py",
"repo_id": "peft",
"token_count": 7337
} | 189 |
"""
Convert weights from https://github.com/google-research/nested-transformer
NOTE: You'll need https://github.com/google/CommonLoopUtils, not included in requirements.txt
"""
import sys
import numpy as np
import torch
from clu import checkpoint
arch_depths = {
'nest_base': [2, 2, 20],
'nest_small': [2, 2... | pytorch-image-models/convert/convert_nest_flax.py/0 | {
"file_path": "pytorch-image-models/convert/convert_nest_flax.py",
"repo_id": "pytorch-image-models",
"token_count": 2670
} | 190 |
# CSP-ResNeXt
**CSPResNeXt** is a convolutional neural network where we apply the Cross Stage Partial Network (CSPNet) approach to [ResNeXt](https://paperswithcode.com/method/resnext). The CSPNet partitions the feature map of the base layer into two parts and then merges them through a cross-stage hierarchy. The use o... | pytorch-image-models/docs/models/.templates/models/csp-resnext.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/csp-resnext.md",
"repo_id": "pytorch-image-models",
"token_count": 916
} | 191 |
# HRNet
**HRNet**, or **High-Resolution Net**, is a general purpose convolutional neural network for tasks like semantic segmentation, object detection and image classification. It is able to maintain high resolution representations through the whole process. We start from a high-resolution convolution stream, gradual... | pytorch-image-models/docs/models/.templates/models/hrnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/hrnet.md",
"repo_id": "pytorch-image-models",
"token_count": 4240
} | 192 |
# RegNetY
**RegNetY** is a convolutional network design space with simple, regular models with parameters: depth $d$, initial width $w\_{0} > 0$, and slope $w\_{a} > 0$, and generates a different block width $u\_{j}$ for each block $j < d$. The key restriction for the RegNet types of model is that there is a linear pa... | pytorch-image-models/docs/models/.templates/models/regnety.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/regnety.md",
"repo_id": "pytorch-image-models",
"token_count": 5944
} | 193 |
# SWSL ResNet
**Residual Networks**, or **ResNets**, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack [residual ... | pytorch-image-models/docs/models/.templates/models/swsl-resnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/swsl-resnet.md",
"repo_id": "pytorch-image-models",
"token_count": 1630
} | 194 |
# CSP-ResNet
**CSPResNet** is a convolutional neural network where we apply the Cross Stage Partial Network (CSPNet) approach to [ResNet](https://paperswithcode.com/method/resnet). The CSPNet partitions the feature map of the base layer into two parts and then merges them through a cross-stage hierarchy. The use of a ... | pytorch-image-models/docs/models/csp-resnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/csp-resnet.md",
"repo_id": "pytorch-image-models",
"token_count": 1703
} | 195 |
# (Gluon) Xception
**Xception** is a convolutional neural network architecture that relies solely on [depthwise separable convolution](https://paperswithcode.com/method/depthwise-separable-convolution) layers.
The weights from this model were ported from [Gluon](https://cv.gluon.ai/model_zoo/classification.html).
##... | pytorch-image-models/docs/models/gloun-xception.md/0 | {
"file_path": "pytorch-image-models/docs/models/gloun-xception.md",
"repo_id": "pytorch-image-models",
"token_count": 1559
} | 196 |
# RegNetX
**RegNetX** is a convolutional network design space with simple, regular models with parameters: depth $d$, initial width $w\_{0} > 0$, and slope $w\_{a} > 0$, and generates a different block width $u\_{j}$ for each block $j < d$. The key restriction for the RegNet types of model is that there is a linear pa... | pytorch-image-models/docs/models/regnetx.md/0 | {
"file_path": "pytorch-image-models/docs/models/regnetx.md",
"repo_id": "pytorch-image-models",
"token_count": 6551
} | 197 |
# SSL ResNeXT
A **ResNeXt** repeats a [building block](https://paperswithcode.com/method/resnext-block) that aggregates a set of transformations with the same topology. Compared to a [ResNet](https://paperswithcode.com/method/resnet), it exposes a new dimension, *cardinality* (the size of the set of transformations) ... | pytorch-image-models/docs/models/ssl-resnext.md/0 | {
"file_path": "pytorch-image-models/docs/models/ssl-resnext.md",
"repo_id": "pytorch-image-models",
"token_count": 3444
} | 198 |
# Hugging Face Timm Docs
## Getting Started
```
pip install git+https://github.com/huggingface/doc-builder.git@main#egg=hf-doc-builder
pip install watchdog black
```
## Preview the Docs Locally
```
doc-builder preview timm hfdocs/source
```
| pytorch-image-models/hfdocs/README.md/0 | {
"file_path": "pytorch-image-models/hfdocs/README.md",
"repo_id": "pytorch-image-models",
"token_count": 88
} | 199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.