Skip to content

Commit

Permalink
delete duplicated lines
Browse files Browse the repository at this point in the history
  • Loading branch information
QtacierP committed Mar 9, 2023
1 parent 7d23881 commit 308c93d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 33 deletions.
4 changes: 0 additions & 4 deletions led/models/ema.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import copy
import os
import random
from typing import Any, Dict, Iterable, Optional, Union

import numpy as np
import torch
from diffusers.utils import deprecate

Expand Down
7 changes: 0 additions & 7 deletions led/models/unet.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
from dataclasses import dataclass
from typing import Optional, Tuple, Union

import torch
import torch.nn as nn

from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.utils import BaseOutput
from diffusers.models.embeddings import GaussianFourierProjection, TimestepEmbedding, Timesteps
from diffusers.models.modeling_utils import ModelMixin
from diffusers.models.unet_2d_blocks import get_down_block, UNetMidBlock2D, get_up_block
from diffusers.models.unet_2d import UNet2DOutput
import torch.nn.functional as F
from omegaconf import OmegaConf

_default_config = OmegaConf.load("led/models/default_config.yaml")


class UNet2DGenerator(ModelMixin, ConfigMixin):
r"""
UNet2DModel is a 2D UNet model that takes in a noisy sample and a timestep and returns sample shaped output.
Expand Down
14 changes: 0 additions & 14 deletions led/pipelines/led_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import List, Optional, Union
import numpy as np
import torch
Expand Down
6 changes: 2 additions & 4 deletions led/trainers/led_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from accelerate import Accelerator
import os
from tqdm import tqdm
from diffusers import DDPMScheduler, DDPMPipeline, DDIMPipeline, StableDiffusionImg2ImgPipeline
from diffusers import DDPMScheduler
from accelerate.utils import ProjectConfiguration
from diffusers.optimization import get_cosine_schedule_with_warmup
from led.models import build_model
import torch.nn.functional as F
from led.data import build_dataset
Expand All @@ -16,8 +15,7 @@
import math
import numpy as np
from accelerate.logging import get_logger
from diffusers.utils import check_min_version, is_wandb_available
import tensorboard
from diffusers.utils import is_wandb_available
import logging
import diffusers
import datasets
Expand Down
5 changes: 1 addition & 4 deletions script/train.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import yaml
import argparse
import os
import sys
# add current path to workspace
sys.path.append(os.getcwd())
from led.trainers.led_trainer import Trainer
from bunch import Bunch
import os
import torch
from omegaconf import OmegaConf, listconfig
from omegaconf import OmegaConf



Expand Down

0 comments on commit 308c93d

Please sign in to comment.