1
This commit is contained in:
53
app/core/config.py
Normal file
53
app/core/config.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import BaseSettings
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))
|
||||
load_dotenv(os.path.join(BASE_DIR, '.env'))
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
PROJECT_NAME = os.getenv('PROJECT_NAME', 'FASTAPI BASE')
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', '')
|
||||
API_PREFIX = ''
|
||||
BACKEND_CORS_ORIGINS = ['*']
|
||||
DATABASE_URL = os.getenv('SQL_DATABASE_URL', '')
|
||||
ACCESS_TOKEN_EXPIRE_SECONDS: int = 60 * 60 * 24 * 7 # Token expired after 7 days
|
||||
SECURITY_ALGORITHM = 'HS256'
|
||||
LOGGING_CONFIG_FILE = os.path.join(BASE_DIR, 'logging_env.py')
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
ckpt = 'service/super_resolution_ccsr/weights/real-world_ccsr.ckpt'
|
||||
config = 'service/super_resolution_ccsr/configs/model/ccsr_stage2.yaml'
|
||||
steps = 45
|
||||
sr_scale = 4
|
||||
repeat_times = 1
|
||||
tiled = False
|
||||
tile_size = 512
|
||||
tile_stride = 256
|
||||
color_fix_type = "adain"
|
||||
t_max = 0.6667
|
||||
t_min = 0.3333
|
||||
show_lq = False
|
||||
skip_if_exist = False
|
||||
seed = 233
|
||||
device = "cuda"
|
||||
tile_diffusion = False #
|
||||
tile_diffusion_size = 512
|
||||
tile_diffusion_stride = 256
|
||||
tile_vae = True
|
||||
vae_decoder_tile_size = 224
|
||||
vae_encoder_tile_size = 1024
|
||||
strength = 1
|
||||
# minio 配置
|
||||
sr_bucket = "test"
|
||||
MINIO_IP = "www.minio.aida.com.hk"
|
||||
MINIO_PORT = 9000
|
||||
MINIO_ACCESS = 'vXKFLSJkYeEq2DrSZvkB'
|
||||
MINIO_SECRET = 'uKTZT3x7C43WvPN9QTc99DiRkwddWZrG9Uh3JVlR'
|
||||
MINIO_SECURE = True
|
||||
# input = 'preprocess_img/input_x2' # 这个值需要被函数参数覆盖
|
||||
# output = '/path/to/output' # 这个值将被函数参数覆盖
|
||||
LOGS_PATH = "logs/errors.log"
|
||||
Reference in New Issue
Block a user