Enable ruff import sorting

Topic: import_sorting
This commit is contained in:
Hayk Martiros 2022-12-26 18:12:02 -08:00
parent d0fe85a4db
commit e48ec2e103
13 changed files with 20 additions and 24 deletions

View File

@ -8,14 +8,13 @@ For more on the Truss file format, see https://truss.baseten.co/
import typing as T
import torch
import dacite
import torch
from huggingface_hub import snapshot_download
from riffusion.datatypes import InferenceInput
from riffusion.riffusion_pipeline import RiffusionPipeline
from riffusion.server import compute_request
from riffusion.datatypes import InferenceInput
class Model:

View File

@ -12,7 +12,7 @@ select = [
"E",
"W",
# isort
# "I001"
"I001"
]
ignore = []

View File

@ -6,8 +6,8 @@ from pathlib import Path
import argh
import numpy as np
from PIL import Image
import pydub
from PIL import Image
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
from riffusion.spectrogram_params import SpectrogramParams

View File

@ -3,8 +3,8 @@ Data model for the riffusion API.
"""
from __future__ import annotations
from dataclasses import dataclass
import typing as T
from dataclasses import dataclass
@dataclass(frozen=True)

View File

@ -9,15 +9,14 @@ import inspect
import typing as T
import numpy as np
from PIL import Image
import torch
from diffusers.models import AutoencoderKL, UNet2DConditionModel
from diffusers.pipeline_utils import DiffusionPipeline
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
from diffusers.utils import logging
from huggingface_hub import hf_hub_download
from PIL import Image
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
from riffusion.datatypes import InferenceInput

View File

@ -3,21 +3,19 @@ Flask server that serves the riffusion model as an API.
"""
import dataclasses
import logging
import io
import json
from pathlib import Path
import logging
import time
import typing as T
from pathlib import Path
import dacite
import flask
from flask_cors import CORS
import PIL
from flask_cors import CORS
from riffusion.datatypes import InferenceInput
from riffusion.datatypes import InferenceOutput
from riffusion.datatypes import InferenceInput, InferenceOutput
from riffusion.riffusion_pipeline import RiffusionPipeline
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
from riffusion.spectrogram_params import SpectrogramParams

View File

@ -1,12 +1,12 @@
import warnings
import numpy as np
import pydub
import torch
import torchaudio
import warnings
from riffusion.spectrogram_params import SpectrogramParams
from riffusion.util import audio_util
from riffusion.util import torch_util
from riffusion.util import audio_util, torch_util
class SpectrogramConverter:

View File

@ -1,6 +1,6 @@
import numpy as np
from PIL import Image
import pydub
from PIL import Image
from riffusion.spectrogram_converter import SpectrogramConverter
from riffusion.spectrogram_params import SpectrogramParams

View File

@ -1,8 +1,8 @@
from __future__ import annotations
import typing as T
from dataclasses import dataclass
from enum import Enum
import typing as T
@dataclass(frozen=True)

View File

@ -1,9 +1,9 @@
import numpy as np
import pydub
from riffusion.util import image_util
from riffusion.spectrogram_converter import SpectrogramConverter
from riffusion.spectrogram_params import SpectrogramParams
from riffusion.util import image_util
from .test_case import TestCase

View File

@ -1,5 +1,5 @@
from pathlib import Path
import subprocess
from pathlib import Path
from .test_case import TestCase

View File

@ -1,8 +1,8 @@
import dataclasses
import typing as T
from PIL import Image
import pydub
from PIL import Image
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
from riffusion.spectrogram_params import SpectrogramParams

View File

@ -1,10 +1,10 @@
import os
from pathlib import Path
import shutil
import tempfile
import typing as T
import warnings
import unittest
import warnings
from pathlib import Path
class TestCase(unittest.TestCase):