text
stringlengths
5
409k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
572
# Copyright 2024 The CogView team, Tsinghua University & ZhipuAI 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/l...
diffusers/src/diffusers/models/transformers/transformer_cogview3plus.py/0
{ "file_path": "diffusers/src/diffusers/models/transformers/transformer_cogview3plus.py", "repo_id": "diffusers", "token_count": 6899 }
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/models/unets/unet_2d_condition.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/unet_2d_condition.py", "repo_id": "diffusers", "token_count": 29830 }
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/pipelines/audioldm/pipeline_audioldm.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/audioldm/pipeline_audioldm.py", "repo_id": "diffusers", "token_count": 11663 }
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/pipelines/controlnet/pipeline_controlnet.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet/pipeline_controlnet.py", "repo_id": "diffusers", "token_count": 30679 }
130
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_flax_available, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {} try: if not (is_transfor...
diffusers/src/diffusers/pipelines/controlnet_xs/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet_xs/__init__.py", "repo_id": "diffusers", "token_count": 894 }
131
from dataclasses import dataclass from typing import List, Optional, Union import numpy as np import PIL.Image from ...utils import BaseOutput @dataclass class IFPipelineOutput(BaseOutput): r""" Output class for Stable Diffusion pipelines. Args: images (`List[PIL.Image.Image]` or `np.ndarray`):...
diffusers/src/diffusers/pipelines/deepfloyd_if/pipeline_output.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/pipeline_output.py", "repo_id": "diffusers", "token_count": 410 }
132
from typing import TYPE_CHECKING from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule _import_structure = {"pipeline_pndm": ["PNDMPipeline"]} if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT: from .pipeline_pndm import PNDMPipeline else: import sys sys.modules[__name__] = _LazyModule( __name__, ...
diffusers/src/diffusers/pipelines/deprecated/pndm/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/pndm/__init__.py", "repo_id": "diffusers", "token_count": 182 }
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/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py", "repo_id": "diffusers", "token_count": 6234 }
134
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {} try: if not (is_transformers_available() and i...
diffusers/src/diffusers/pipelines/latent_consistency_models/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/latent_consistency_models/__init__.py", "repo_id": "diffusers", "token_count": 615 }
135
# coding=utf-8 # Copyright 2025 The HuggingFace Inc. team. # Copyright (c) 2022, NVIDIA CORPORATION. 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.a...
diffusers/src/diffusers/pipelines/onnx_utils.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/onnx_utils.py", "repo_id": "diffusers", "token_count": 3657 }
136
from dataclasses import dataclass from typing import List, Union import numpy as np import PIL.Image from ...utils import BaseOutput @dataclass class SanaPipelineOutput(BaseOutput): """ Output class for Sana pipelines. Args: images (`List[PIL.Image.Image]` or `np.ndarray`) List of d...
diffusers/src/diffusers/pipelines/sana/pipeline_output.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/sana/pipeline_output.py", "repo_id": "diffusers", "token_count": 211 }
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/stable_cascade/pipeline_stable_cascade_prior.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_prior.py", "repo_id": "diffusers", "token_count": 14327 }
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/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py", "repo_id": "diffusers", "token_count": 22907 }
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_safe/safety_checker.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_safe/safety_checker.py", "repo_id": "diffusers", "token_count": 1962 }
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/text_to_video_synthesis/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/__init__.py", "repo_id": "diffusers", "token_count": 788 }
141
# Copyright (c) 2022 Dominic Rampas 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 with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
diffusers/src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py", "repo_id": "diffusers", "token_count": 3040 }
142
# Copyright 2024 The HuggingFace Team and City96. 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 # # # # U...
diffusers/src/diffusers/quantizers/gguf/utils.py/0
{ "file_path": "diffusers/src/diffusers/quantizers/gguf/utils.py", "repo_id": "diffusers", "token_count": 7409 }
143
# Copyright 2024 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-2.0 # # Unless...
diffusers/src/diffusers/schedulers/scheduling_euler_discrete.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_euler_discrete.py", "repo_id": "diffusers", "token_count": 15517 }
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/scheduling_sde_ve.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_sde_ve.py", "repo_id": "diffusers", "token_count": 5379 }
145
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class MidiProcessor(metaclass=DummyObject): _backends = ["note_seq"] def __init__(self, *args, **kwargs): requires_backends(self, ["note_seq"]) @classmethod def from...
diffusers/src/diffusers/utils/dummy_note_seq_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_note_seq_objects.py", "repo_id": "diffusers", "token_count": 201 }
146
# coding=utf-8 # Copyright 2024 Optuna, Hugging Face # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not 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 o...
diffusers/src/diffusers/utils/logging.py/0
{ "file_path": "diffusers/src/diffusers/utils/logging.py", "repo_id": "diffusers", "token_count": 3654 }
147
# 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/hooks/test_group_offloading.py/0
{ "file_path": "diffusers/tests/hooks/test_group_offloading.py", "repo_id": "diffusers", "token_count": 3873 }
148
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/models/autoencoders/test_models_asymmetric_autoencoder_kl.py/0
{ "file_path": "diffusers/tests/models/autoencoders/test_models_asymmetric_autoencoder_kl.py", "repo_id": "diffusers", "token_count": 4339 }
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/models/test_modeling_common.py/0
{ "file_path": "diffusers/tests/models/test_modeling_common.py", "repo_id": "diffusers", "token_count": 32603 }
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/transformers/test_models_transformer_ltx.py/0
{ "file_path": "diffusers/tests/models/transformers/test_models_transformer_ltx.py", "repo_id": "diffusers", "token_count": 1118 }
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/unets/test_models_unet_spatiotemporal.py/0
{ "file_path": "diffusers/tests/models/unets/test_models_unet_spatiotemporal.py", "repo_id": "diffusers", "token_count": 3217 }
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/audioldm2/test_audioldm2.py/0
{ "file_path": "diffusers/tests/pipelines/audioldm2/test_audioldm2.py", "repo_id": "diffusers", "token_count": 11209 }
153
# coding=utf-8 # Copyright 2024 HuggingFace Inc and Tencent Hunyuan 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 require...
diffusers/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py/0
{ "file_path": "diffusers/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py", "repo_id": "diffusers", "token_count": 6131 }
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_superresolution.py/0
{ "file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if_img2img_superresolution.py", "repo_id": "diffusers", "token_count": 2445 }
155
# Copyright 2024 The HuggingFace Team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
diffusers/tests/pipelines/hunyuan_video/test_hunyuan_skyreels_image2video.py/0
{ "file_path": "diffusers/tests/pipelines/hunyuan_video/test_hunyuan_skyreels_image2video.py", "repo_id": "diffusers", "token_count": 5799 }
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/kandinsky2_2/test_kandinsky_controlnet.py/0
{ "file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py", "repo_id": "diffusers", "token_count": 4359 }
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/latent_diffusion/test_latent_diffusion.py/0
{ "file_path": "diffusers/tests/pipelines/latent_diffusion/test_latent_diffusion.py", "repo_id": "diffusers", "token_count": 3447 }
158
# Copyright 2024 The HuggingFace Team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
diffusers/tests/pipelines/pag/test_pag_sana.py/0
{ "file_path": "diffusers/tests/pipelines/pag/test_pag_sana.py", "repo_id": "diffusers", "token_count": 6073 }
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/stable_cascade/test_stable_cascade_prior.py/0
{ "file_path": "diffusers/tests/pipelines/stable_cascade/test_stable_cascade_prior.py", "repo_id": "diffusers", "token_count": 4657 }
160
# 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_flax_inpaint.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_flax_inpaint.py", "repo_id": "diffusers", "token_count": 1237 }
161
# 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_image_variation/test_stable_diffusion_image_variation.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_image_variation/test_stable_diffusion_image_variation.py", "repo_id": "diffusers", "token_count": 5920 }
162
# coding=utf-8 # Copyright 2024 Harutatsu Akiyama and 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 b...
diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_instruction_pix2pix.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_instruction_pix2pix.py", "repo_id": "diffusers", "token_count": 3108 }
163
# 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/text_to_video_synthesis/test_text_to_video_zero.py/0
{ "file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py", "repo_id": "diffusers", "token_count": 710 }
164
import gc import unittest import numpy as np import torch import torch.nn as nn from diffusers import ( AuraFlowPipeline, AuraFlowTransformer2DModel, FluxPipeline, FluxTransformer2DModel, GGUFQuantizationConfig, SD3Transformer2DModel, StableDiffusion3Pipeline, ) from diffusers.utils.testin...
diffusers/tests/quantization/gguf/test_gguf.py/0
{ "file_path": "diffusers/tests/quantization/gguf/test_gguf.py", "repo_id": "diffusers", "token_count": 8795 }
165
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 }
166
import unittest 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": 715 }
167
import gc import tempfile import unittest import torch from diffusers import EulerDiscreteScheduler, StableDiffusionInstructPix2PixPipeline, StableDiffusionPipeline from diffusers.loaders.single_file_utils import _extract_repo_id_and_weights_name from diffusers.utils import load_image from diffusers.utils.testing_uti...
diffusers/tests/single_file/test_stable_diffusion_single_file.py/0
{ "file_path": "diffusers/tests/single_file/test_stable_diffusion_single_file.py", "repo_id": "diffusers", "token_count": 2682 }
168
# 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/fetch_latest_release_branch.py/0
{ "file_path": "diffusers/utils/fetch_latest_release_branch.py", "repo_id": "diffusers", "token_count": 824 }
169
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 # Configure image ARG PYTHON_VERSION=3.10 ARG DEBIAN_FRONTEND=noninteractive # Install apt dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential cmake \ git git-lfs openssh-client \ nano vim less util-linux tree \ htop...
lerobot/docker/lerobot-gpu-dev/Dockerfile/0
{ "file_path": "lerobot/docker/lerobot-gpu-dev/Dockerfile", "repo_id": "lerobot", "token_count": 993 }
170
# keys OBS_ENV = "observation.environment_state" OBS_ROBOT = "observation.state" OBS_IMAGE = "observation.image" OBS_IMAGES = "observation.images" ACTION = "action" # files & directories CHECKPOINTS_DIR = "checkpoints" LAST_CHECKPOINT_LINK = "last" PRETRAINED_MODEL_DIR = "pretrained_model" TRAINING_STATE_DIR = "traini...
lerobot/lerobot/common/constants.py/0
{ "file_path": "lerobot/lerobot/common/constants.py", "repo_id": "lerobot", "token_count": 227 }
171
#!/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/factory.py/0
{ "file_path": "lerobot/lerobot/common/policies/factory.py", "repo_id": "lerobot", "token_count": 2379 }
172
#!/usr/bin/env python # Copyright 2024 Seungjae Lee and Yibin Wang and Haritheja Etukuru # and H. Jin Kim and Nur Muhammad Mahi Shafiullah and Lerrel Pinto # and 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 com...
lerobot/lerobot/common/policies/vqbet/vqbet_utils.py/0
{ "file_path": "lerobot/lerobot/common/policies/vqbet/vqbet_utils.py", "repo_id": "lerobot", "token_count": 24283 }
173
from typing import Protocol from lerobot.common.robot_devices.robots.configs import ( AlohaRobotConfig, KochBimanualRobotConfig, KochRobotConfig, ManipulatorRobotConfig, MossRobotConfig, RobotConfig, So100RobotConfig, StretchRobotConfig, ) def get_arm_id(name, arm_type): """Return...
lerobot/lerobot/common/robot_devices/robots/utils.py/0
{ "file_path": "lerobot/lerobot/common/robot_devices/robots/utils.py", "repo_id": "lerobot", "token_count": 779 }
174
# Note: We subclass str so that serialization is straightforward # https://stackoverflow.com/questions/24481852/serialising-an-enum-member-to-json from dataclasses import dataclass from enum import Enum from typing import Any, Protocol class FeatureType(str, Enum): STATE = "STATE" VISUAL = "VISUAL" ENV = ...
lerobot/lerobot/configs/types.py/0
{ "file_path": "lerobot/lerobot/configs/types.py", "repo_id": "lerobot", "token_count": 224 }
175
version https://git-lfs.github.com/spec/v1 oid sha256:96431ca3479eef2379406ef901cad7ba5eac4f7edcc48ecc9e8d1fa0e99d8017 size 111338
lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_81.safetensors/0
{ "file_path": "lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_81.safetensors", "repo_id": "lerobot", "token_count": 67 }
176
version https://git-lfs.github.com/spec/v1 oid sha256:683a2038185f3d070e7d7c0c31e4aa75067c11bf798daa41c9fab336f4183fda size 33400
lerobot/tests/data/save_policy_to_safetensors/aloha_act_1000_steps/param_stats.safetensors/0
{ "file_path": "lerobot/tests/data/save_policy_to_safetensors/aloha_act_1000_steps/param_stats.safetensors", "repo_id": "lerobot", "token_count": 65 }
177
version https://git-lfs.github.com/spec/v1 oid sha256:b7d08c9518f1f15226e4efc6f2a8542d0f3e620c91421c7cacea07d9bd9025d6 size 36312
lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_policy/param_stats.safetensors/0
{ "file_path": "lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_policy/param_stats.safetensors", "repo_id": "lerobot", "token_count": 71 }
178
""" Tests for physical robots and their mocked versions. If the physical robots are not connected to the computer, or not working, the test will be skipped. Example of running a specific test: ```bash pytest -sx tests/test_control_robot.py::test_teleoperate ``` Example of running test on real robots connected to the ...
lerobot/tests/test_control_robot.py/0
{ "file_path": "lerobot/tests/test_control_robot.py", "repo_id": "lerobot", "token_count": 6683 }
179
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
lerobot/tests/test_sampler.py/0
{ "file_path": "lerobot/tests/test_sampler.py", "repo_id": "lerobot", "token_count": 1429 }
180
compute_environment: LOCAL_MACHINE debug: false deepspeed_config: deepspeed_multinode_launcher: standard offload_optimizer_device: none offload_param_device: none zero3_init_flag: false zero_stage: 2 distributed_type: DEEPSPEED downcast_bf16: 'no' machine_rank: 0 main_training_function: main mixed_precision: ...
open-r1/recipes/accelerate_configs/zero2.yaml/0
{ "file_path": "open-r1/recipes/accelerate_configs/zero2.yaml", "repo_id": "open-r1", "token_count": 179 }
181
# Copyright 2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
open-r1/src/open_r1/evaluate.py/0
{ "file_path": "open-r1/src/open_r1/evaluate.py", "repo_id": "open-r1", "token_count": 2348 }
182
# Builds GPU docker image of PyTorch # Uses multi-staged approach to reduce size # Stage 1 # Use base conda image to reduce time FROM continuumio/miniconda3:latest AS compile-image # Specify py version ENV PYTHON_VERSION=3.11 # Install apt libs - copied from https://github.com/huggingface/accelerate/blob/main/docker/ac...
peft/docker/peft-gpu-bnb-latest/Dockerfile/0
{ "file_path": "peft/docker/peft-gpu-bnb-latest/Dockerfile", "repo_id": "peft", "token_count": 816 }
183
<!--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/custom_models.md/0
{ "file_path": "peft/docs/source/developer_guides/custom_models.md", "repo_id": "peft", "token_count": 4859 }
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/examples/boft_controlnet/eval.py/0
{ "file_path": "peft/examples/boft_controlnet/eval.py", "repo_id": "peft", "token_count": 3390 }
185
<!--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/examples/boft_dreambooth/boft_dreambooth.md/0
{ "file_path": "peft/examples/boft_dreambooth/boft_dreambooth.md", "repo_id": "peft", "token_count": 2634 }
186
<jupyter_start><jupyter_code>from transformers import AutoModelForCausalLM from peft import get_peft_config, get_peft_model, PrefixTuningConfig, TaskType, PeftType import torch from datasets import load_dataset import os from transformers import AutoTokenizer from torch.utils.data import DataLoader from transformers im...
peft/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb/0
{ "file_path": "peft/examples/causal_language_modeling/peft_prefix_tuning_clm.ipynb", "repo_id": "peft", "token_count": 4714 }
187
# 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/examples/corda_finetuning/corda_finetuning.py/0
{ "file_path": "peft/examples/corda_finetuning/corda_finetuning.py", "repo_id": "peft", "token_count": 4224 }
188
<jupyter_start><jupyter_code>import argparse import json import logging import math import os import random from pathlib import Path from tqdm import tqdm import datasets from datasets import load_dataset, DatasetDict import evaluate import torch from torch import nn from torch.utils.data import DataLoader import tr...
peft/examples/feature_extraction/peft_lora_embedding_semantic_similarity_inference.ipynb/0
{ "file_path": "peft/examples/feature_extraction/peft_lora_embedding_semantic_similarity_inference.ipynb", "repo_id": "peft", "token_count": 2679 }
189
<jupyter_start><jupyter_text>Fine-tune FLAN-T5 using `bitsandbytes`, `peft` & `transformers` 🤗 In this notebook we will see how to properly use `peft` , `transformers` & `bitsandbytes` to fine-tune `flan-t5-large` in a google colab!We will finetune the model on [`financial_phrasebank`](https://huggingface.co/datasets...
peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb/0
{ "file_path": "peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb", "repo_id": "peft", "token_count": 4290 }
190
<jupyter_start><jupyter_code>import os os.environ["CUDA_VISIBLE_DEVICES"] = "1" from peft import PeftConfig, PeftModel from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer from datasets import load_dataset import torch import random peft_model_id = "smangrul/tinyllama_lo...
peft/examples/multi_adapter_examples/Lora_Merging.ipynb/0
{ "file_path": "peft/examples/multi_adapter_examples/Lora_Merging.ipynb", "repo_id": "peft", "token_count": 1305 }
191
# X-LoRA examples ## `xlora_inference_mistralrs.py` Perform inference of an X-LoRA model using the inference engine mistral.rs. Mistral.rs supports many base models besides Mistral, and can load models directly from saved LoRA checkpoints. Check out [adapter model docs](https://github.com/EricLBuehler/mistral.rs/blo...
peft/examples/xlora/README.md/0
{ "file_path": "peft/examples/xlora/README.md", "repo_id": "peft", "token_count": 320 }
192
# 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/mixed_model.py/0
{ "file_path": "peft/src/peft/mixed_model.py", "repo_id": "peft", "token_count": 8243 }
193
# 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/model.py/0
{ "file_path": "peft/src/peft/tuners/adaption_prompt/model.py", "repo_id": "peft", "token_count": 2846 }
194
# 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/ln_tuning/model.py/0
{ "file_path": "peft/src/peft/tuners/ln_tuning/model.py", "repo_id": "peft", "token_count": 3267 }
195
# Copyright 2024-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/lora/eetq.py/0
{ "file_path": "peft/src/peft/tuners/lora/eetq.py", "repo_id": "peft", "token_count": 1928 }
196
# 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/oft/layer.py/0
{ "file_path": "peft/src/peft/tuners/oft/layer.py", "repo_id": "peft", "token_count": 14598 }
197
# 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/tuners_utils.py/0
{ "file_path": "peft/src/peft/tuners/tuners_utils.py", "repo_id": "peft", "token_count": 21148 }
198
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/utils/constants.py/0
{ "file_path": "peft/src/peft/utils/constants.py", "repo_id": "peft", "token_count": 5367 }
199
# 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": 35269 }
200
#!/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_low_level_api.py/0
{ "file_path": "peft/tests/test_low_level_api.py", "repo_id": "peft", "token_count": 1362 }
201
""" 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 }
202
# DenseNet **DenseNet** is a type of convolutional neural network that utilises dense connections between layers, through [Dense Blocks](http://www.paperswithcode.com/method/dense-block), where we connect *all layers* (with matching feature-map sizes) directly with each other. To preserve the feed-forward nature, each...
pytorch-image-models/hfdocs/source/models/densenet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/densenet.mdx", "repo_id": "pytorch-image-models", "token_count": 4190 }
203
# Instagram ResNeXt WSL 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 transfo...
pytorch-image-models/hfdocs/source/models/ig-resnext.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/ig-resnext.mdx", "repo_id": "pytorch-image-models", "token_count": 3233 }
204
# Res2Net **Res2Net** is an image model that employs a variation on bottleneck residual blocks, [Res2Net Blocks](https://paperswithcode.com/method/res2net-block). The motivation is to be able to represent features at multiple scales. This is achieved through a novel building block for CNNs that constructs hierarchical...
pytorch-image-models/hfdocs/source/models/res2net.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/res2net.mdx", "repo_id": "pytorch-image-models", "token_count": 3952 }
205
# (Tensorflow) EfficientNet CondConv **EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method unifor...
pytorch-image-models/hfdocs/source/models/tf-efficientnet-condconv.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/tf-efficientnet-condconv.mdx", "repo_id": "pytorch-image-models", "token_count": 3326 }
206
dependencies = ['torch'] import timm globals().update(timm.models._registry._model_entrypoints)
pytorch-image-models/hubconf.py/0
{ "file_path": "pytorch-image-models/hubconf.py", "repo_id": "pytorch-image-models", "token_count": 32 }
207
[dist_conda] conda_name_differences = 'torch:pytorch' channels = pytorch noarch = True [metadata] url = "https://github.com/huggingface/pytorch-image-models"
pytorch-image-models/setup.cfg/0
{ "file_path": "pytorch-image-models/setup.cfg", "repo_id": "pytorch-image-models", "token_count": 65 }
208
""" Quick n Simple Image Folder, Tarfile based DataSet Hacked together by / Copyright 2019, Ross Wightman """ import io import logging from typing import Optional import torch import torch.utils.data as data from PIL import Image from .readers import create_reader _logger = logging.getLogger(__name__) _ERROR_RETR...
pytorch-image-models/timm/data/dataset.py/0
{ "file_path": "pytorch-image-models/timm/data/dataset.py", "repo_id": "pytorch-image-models", "token_count": 2991 }
209
""" A dataset reader that reads tarfile based datasets This reader can extract image samples from: * a single tar of image files * a folder of multiple tarfiles containing imagefiles * a tar of tars containing image files Labels are based on the combined folder and/or tar name structure. Hacked together by / Copyrig...
pytorch-image-models/timm/data/readers/reader_image_in_tar.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_image_in_tar.py", "repo_id": "pytorch-image-models", "token_count": 4050 }
210
""" BlurPool layer inspired by - Kornia's Max_BlurPool2d - Making Convolutional Networks Shift-Invariant Again :cite:`zhang2019shiftinvar` Hacked together by Chris Ha and Ross Wightman """ from functools import partial from typing import Optional, Type import torch import torch.nn as nn import torch.nn.functional a...
pytorch-image-models/timm/layers/blur_pool.py/0
{ "file_path": "pytorch-image-models/timm/layers/blur_pool.py", "repo_id": "pytorch-image-models", "token_count": 1352 }
211
""" 'Fast' Normalization Functions For GroupNorm and LayerNorm these functions bypass typical AMP upcast to float32. Additionally, for LayerNorm, the APEX fused LN is used if available (which also does not upcast) Hacked together by / Copyright 2022 Ross Wightman """ from typing import List, Optional import torch f...
pytorch-image-models/timm/layers/fast_norm.py/0
{ "file_path": "pytorch-image-models/timm/layers/fast_norm.py", "repo_id": "pytorch-image-models", "token_count": 2881 }
212
""" PyTorch Mixed Convolution Paper: MixConv: Mixed Depthwise Convolutional Kernels (https://arxiv.org/abs/1907.09595) Hacked together by / Copyright 2020 Ross Wightman """ import torch from torch import nn as nn from .conv2d_same import create_conv2d_pad def _split_channels(num_chan, num_groups): split = [nu...
pytorch-image-models/timm/layers/mixed_conv2d.py/0
{ "file_path": "pytorch-image-models/timm/layers/mixed_conv2d.py", "repo_id": "pytorch-image-models", "token_count": 834 }
213
""" Split Attention Conv2d (for ResNeSt Models) Paper: `ResNeSt: Split-Attention Networks` - /https://arxiv.org/abs/2004.08955 Adapted from original PyTorch impl at https://github.com/zhanghang1989/ResNeSt Modified for torchscript compat, performance, and consistency with timm by Ross Wightman """ import torch impor...
pytorch-image-models/timm/layers/split_attn.py/0
{ "file_path": "pytorch-image-models/timm/layers/split_attn.py", "repo_id": "pytorch-image-models", "token_count": 1533 }
214
""" EfficientNet, MobileNetV3, etc Builder Assembles EfficieNet and related network feature blocks from string definitions. Handles stride, dilation calculations, and selects feature extraction points. Hacked together by / Copyright 2019, Ross Wightman """ from typing import Callable, Optional import logging import ...
pytorch-image-models/timm/models/_efficientnet_builder.py/0
{ "file_path": "pytorch-image-models/timm/models/_efficientnet_builder.py", "repo_id": "pytorch-image-models", "token_count": 10990 }
215
""" Bring-Your-Own-Attention Network A flexible network w/ dataclass based config for stacking NN blocks including self-attention (or similar) layers. Currently used to implement experimental variants of: * Bottleneck Transformers * Lambda ResNets * HaloNets Consider all of the models definitions here as exper...
pytorch-image-models/timm/models/byoanet.py/0
{ "file_path": "pytorch-image-models/timm/models/byoanet.py", "repo_id": "pytorch-image-models", "token_count": 9703 }
216
""" EfficientFormer-V2 @article{ li2022rethinking, title={Rethinking Vision Transformers for MobileNet Size and Speed}, author={Li, Yanyu and Hu, Ju and Wen, Yang and Evangelidis, Georgios and Salahi, Kamyar and Wang, Yanzhi and Tulyakov, Sergey and Ren, Jian}, journal={arXiv preprint arXiv:2212.08059}...
pytorch-image-models/timm/models/efficientformer_v2.py/0
{ "file_path": "pytorch-image-models/timm/models/efficientformer_v2.py", "repo_id": "pytorch-image-models", "token_count": 12757 }
217
import math from copy import deepcopy from functools import partial from typing import Callable, Dict, List, Optional, Tuple, Union import torch import torch.nn as nn import torch.nn.functional as F from torch.jit import Final from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.layers import P...
pytorch-image-models/timm/models/hieradet_sam2.py/0
{ "file_path": "pytorch-image-models/timm/models/hieradet_sam2.py", "repo_id": "pytorch-image-models", "token_count": 11828 }
218
""" NasNet-A (Large) nasnetalarge implementation grabbed from Cadene's pretrained models https://github.com/Cadene/pretrained-models.pytorch """ from functools import partial from typing import Optional import torch import torch.nn as nn import torch.nn.functional as F from timm.layers import ConvNormAct, create_co...
pytorch-image-models/timm/models/nasnet.py/0
{ "file_path": "pytorch-image-models/timm/models/nasnet.py", "repo_id": "pytorch-image-models", "token_count": 13276 }
219
""" ReXNet A PyTorch impl of `ReXNet: Diminishing Representational Bottleneck on Convolutional Neural Network` - https://arxiv.org/abs/2007.00992 Adapted from original impl at https://github.com/clovaai/rexnet Copyright (c) 2020-present NAVER Corp. MIT license Changes for timm, feature extraction, and rounded channe...
pytorch-image-models/timm/models/rexnet.py/0
{ "file_path": "pytorch-image-models/timm/models/rexnet.py", "repo_id": "pytorch-image-models", "token_count": 5803 }
220
""" Relative Position Vision Transformer (ViT) in PyTorch NOTE: these models are experimental / WIP, expect changes Hacked together by / Copyright 2022, Ross Wightman """ import logging import math from functools import partial from typing import List, Optional, Tuple, Type, Union try: from typing import Literal...
pytorch-image-models/timm/models/vision_transformer_relpos.py/0
{ "file_path": "pytorch-image-models/timm/models/vision_transformer_relpos.py", "repo_id": "pytorch-image-models", "token_count": 13346 }
221
""" AdamP Optimizer Implementation copied from https://github.com/clovaai/AdamP/blob/master/adamp/adamp.py Paper: `Slowing Down the Weight Norm Increase in Momentum-based Optimizers` - https://arxiv.org/abs/2006.08217 Code: https://github.com/clovaai/AdamP Copyright (c) 2020-present NAVER Corp. MIT license """ impor...
pytorch-image-models/timm/optim/adamp.py/0
{ "file_path": "pytorch-image-models/timm/optim/adamp.py", "repo_id": "pytorch-image-models", "token_count": 2028 }
222
"""RAdam Optimizer. Implementation lifted from: https://github.com/LiyuanLucasLiu/RAdam Paper: `On the Variance of the Adaptive Learning Rate and Beyond` - https://arxiv.org/abs/1908.03265 NOTE: This impl has been deprecated in favour of torch.optim.RAdam and remains as a reference """ import math import torch from to...
pytorch-image-models/timm/optim/radam.py/0
{ "file_path": "pytorch-image-models/timm/optim/radam.py", "repo_id": "pytorch-image-models", "token_count": 2159 }
223
import fnmatch import re from collections import OrderedDict from typing import Union, Optional, List import torch class AttentionExtract(torch.nn.Module): # defaults should cover a significant number of timm models with attention maps. default_node_names = ['*attn.softmax'] default_module_names = ['*att...
pytorch-image-models/timm/utils/attention_extract.py/0
{ "file_path": "pytorch-image-models/timm/utils/attention_extract.py", "repo_id": "pytorch-image-models", "token_count": 1467 }
224
#!/usr/bin/env python3 """ ImageNet Training Script This is intended to be a lean and easily modifiable ImageNet training script that reproduces ImageNet training results with some of the latest networks and training techniques. It favours canonical PyTorch and standard Python style over trying to be able to 'do it al...
pytorch-image-models/train.py/0
{ "file_path": "pytorch-image-models/train.py", "repo_id": "pytorch-image-models", "token_count": 26015 }
225
<!--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...
smolagents/docs/source/en/conceptual_guides/intro_agents.mdx/0
{ "file_path": "smolagents/docs/source/en/conceptual_guides/intro_agents.mdx", "repo_id": "smolagents", "token_count": 2434 }
226