mirror of https://github.com/skygpu/skynet.git
				
				
				
			Some more `import` fixes
Removing unused imports in a few modules as well as converting a few more tuple imports to multi-line style. We should prolly consider a linter as part of pre-merge machinery; I noticed a few pretty low hanging pep8 violations just spelunking rando modules ;)pull/48/head
							parent
							
								
									7cb9f09d95
								
							
						
					
					
						commit
						fd3e0feffe
					
				| 
						 | 
				
			
			@ -3,8 +3,6 @@
 | 
			
		|||
import os
 | 
			
		||||
import toml
 | 
			
		||||
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
 | 
			
		||||
from .constants import DEFAULT_CONFIG_PATH
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,22 +1,24 @@
 | 
			
		|||
#!/usr/bin/python
 | 
			
		||||
import msgspec
 | 
			
		||||
from typing import Literal
 | 
			
		||||
 | 
			
		||||
VERSION = '0.1a12'
 | 
			
		||||
 | 
			
		||||
DOCKER_RUNTIME_CUDA = 'skynet:runtime-cuda'
 | 
			
		||||
 | 
			
		||||
import msgspec
 | 
			
		||||
from typing import Literal
 | 
			
		||||
 | 
			
		||||
class Size(msgspec.Struct):
 | 
			
		||||
    w: int
 | 
			
		||||
    h: int
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ModelDesc(msgspec.Struct):
 | 
			
		||||
    short: str
 | 
			
		||||
    mem: float
 | 
			
		||||
    size: Size
 | 
			
		||||
    tags: list[Literal['txt2img', 'img2img', 'inpaint']]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
MODELS: dict[str, ModelDesc] = {
 | 
			
		||||
    'runwayml/stable-diffusion-v1-5': ModelDesc(
 | 
			
		||||
        short='stable',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,11 +8,18 @@ import asyncio
 | 
			
		|||
from decimal import Decimal
 | 
			
		||||
from hashlib import sha256
 | 
			
		||||
from datetime import datetime
 | 
			
		||||
from contextlib import ExitStack, AsyncExitStack
 | 
			
		||||
from contextlib import (
 | 
			
		||||
    ExitStack,
 | 
			
		||||
    AsyncExitStack,
 | 
			
		||||
)
 | 
			
		||||
from contextlib import asynccontextmanager as acm
 | 
			
		||||
 | 
			
		||||
from leap.cleos import CLEOS
 | 
			
		||||
from leap.sugar import Name, asset_from_str, collect_stdout
 | 
			
		||||
from leap.sugar import (
 | 
			
		||||
    Name,
 | 
			
		||||
    asset_from_str,
 | 
			
		||||
    collect_stdout,
 | 
			
		||||
)
 | 
			
		||||
from leap.hyperion import HyperionAPI
 | 
			
		||||
# from telebot.types import InputMediaPhoto
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,9 +9,7 @@ import logging
 | 
			
		|||
import importlib
 | 
			
		||||
 | 
			
		||||
from typing import Optional
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
 | 
			
		||||
import trio
 | 
			
		||||
import torch
 | 
			
		||||
import numpy as np
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -112,6 +110,7 @@ def pipeline_for(
 | 
			
		|||
        return custom_pipeline.pipeline_for(model, mode, mem_fraction=mem_fraction, cache_dir=cache_dir)
 | 
			
		||||
 | 
			
		||||
    except ImportError:
 | 
			
		||||
        # TODO, uhh why not warn/error log this?
 | 
			
		||||
        ...
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue