parent
d0fe85a4db
commit
e48ec2e103
|
@ -8,14 +8,13 @@ For more on the Truss file format, see https://truss.baseten.co/
|
||||||
|
|
||||||
import typing as T
|
import typing as T
|
||||||
|
|
||||||
import torch
|
|
||||||
import dacite
|
import dacite
|
||||||
|
import torch
|
||||||
from huggingface_hub import snapshot_download
|
from huggingface_hub import snapshot_download
|
||||||
|
|
||||||
|
from riffusion.datatypes import InferenceInput
|
||||||
from riffusion.riffusion_pipeline import RiffusionPipeline
|
from riffusion.riffusion_pipeline import RiffusionPipeline
|
||||||
from riffusion.server import compute_request
|
from riffusion.server import compute_request
|
||||||
from riffusion.datatypes import InferenceInput
|
|
||||||
|
|
||||||
|
|
||||||
class Model:
|
class Model:
|
||||||
|
|
|
@ -12,7 +12,7 @@ select = [
|
||||||
"E",
|
"E",
|
||||||
"W",
|
"W",
|
||||||
# isort
|
# isort
|
||||||
# "I001"
|
"I001"
|
||||||
]
|
]
|
||||||
|
|
||||||
ignore = []
|
ignore = []
|
||||||
|
|
|
@ -6,8 +6,8 @@ from pathlib import Path
|
||||||
|
|
||||||
import argh
|
import argh
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
|
||||||
import pydub
|
import pydub
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
|
|
|
@ -3,8 +3,8 @@ Data model for the riffusion API.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
import typing as T
|
import typing as T
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|
|
@ -9,15 +9,14 @@ import inspect
|
||||||
import typing as T
|
import typing as T
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from diffusers.models import AutoencoderKL, UNet2DConditionModel
|
from diffusers.models import AutoencoderKL, UNet2DConditionModel
|
||||||
from diffusers.pipeline_utils import DiffusionPipeline
|
from diffusers.pipeline_utils import DiffusionPipeline
|
||||||
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
|
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
|
||||||
from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
|
from diffusers.schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
|
||||||
from diffusers.utils import logging
|
from diffusers.utils import logging
|
||||||
from huggingface_hub import hf_hub_download
|
from huggingface_hub import hf_hub_download
|
||||||
|
from PIL import Image
|
||||||
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
||||||
|
|
||||||
from riffusion.datatypes import InferenceInput
|
from riffusion.datatypes import InferenceInput
|
||||||
|
|
|
@ -3,21 +3,19 @@ Flask server that serves the riffusion model as an API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import logging
|
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
import logging
|
||||||
import time
|
import time
|
||||||
import typing as T
|
import typing as T
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import dacite
|
import dacite
|
||||||
import flask
|
import flask
|
||||||
|
|
||||||
from flask_cors import CORS
|
|
||||||
import PIL
|
import PIL
|
||||||
|
from flask_cors import CORS
|
||||||
|
|
||||||
from riffusion.datatypes import InferenceInput
|
from riffusion.datatypes import InferenceInput, InferenceOutput
|
||||||
from riffusion.datatypes import InferenceOutput
|
|
||||||
from riffusion.riffusion_pipeline import RiffusionPipeline
|
from riffusion.riffusion_pipeline import RiffusionPipeline
|
||||||
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
import warnings
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pydub
|
import pydub
|
||||||
import torch
|
import torch
|
||||||
import torchaudio
|
import torchaudio
|
||||||
import warnings
|
|
||||||
|
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
from riffusion.util import audio_util
|
from riffusion.util import audio_util, torch_util
|
||||||
from riffusion.util import torch_util
|
|
||||||
|
|
||||||
|
|
||||||
class SpectrogramConverter:
|
class SpectrogramConverter:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
|
||||||
import pydub
|
import pydub
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
from riffusion.spectrogram_converter import SpectrogramConverter
|
from riffusion.spectrogram_converter import SpectrogramConverter
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import typing as T
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import typing as T
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pydub
|
import pydub
|
||||||
|
|
||||||
from riffusion.util import image_util
|
|
||||||
from riffusion.spectrogram_converter import SpectrogramConverter
|
from riffusion.spectrogram_converter import SpectrogramConverter
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
|
from riffusion.util import image_util
|
||||||
|
|
||||||
from .test_case import TestCase
|
from .test_case import TestCase
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from pathlib import Path
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from .test_case import TestCase
|
from .test_case import TestCase
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import typing as T
|
import typing as T
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
import pydub
|
import pydub
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
from riffusion.spectrogram_image_converter import SpectrogramImageConverter
|
||||||
from riffusion.spectrogram_params import SpectrogramParams
|
from riffusion.spectrogram_params import SpectrogramParams
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import typing as T
|
import typing as T
|
||||||
import warnings
|
|
||||||
import unittest
|
import unittest
|
||||||
|
import warnings
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class TestCase(unittest.TestCase):
|
class TestCase(unittest.TestCase):
|
||||||
|
|
Loading…
Reference in New Issue