fix: add package
This commit is contained in:
@@ -4,6 +4,7 @@ from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
import torch
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
@@ -23,13 +24,15 @@ class Settings(BaseSettings):
|
||||
paddleocr_vl_url: str = "http://localhost:8080/v1"
|
||||
|
||||
# Model Paths
|
||||
doclayout_model_path: str = "app/model/DocLayout"
|
||||
pp_doclayout_model_dir: str = "app/model/PP-DocLayout"
|
||||
doclayout_model_path: str = "app/model/DocLayout/best.pt"
|
||||
pp_doclayout_model_dir: str = "app/model/PP-DocLayout/PP-DocLayoutV2"
|
||||
|
||||
# Image Processing
|
||||
max_image_size_mb: int = 10
|
||||
image_padding_ratio: float = 0.15 # 15% on each side = 30% total expansion
|
||||
|
||||
device: torch.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # cuda:0 or cpu
|
||||
|
||||
# Server Settings
|
||||
host: str = "0.0.0.0"
|
||||
port: int = 8053
|
||||
@@ -49,4 +52,3 @@ class Settings(BaseSettings):
|
||||
def get_settings() -> Settings:
|
||||
"""Get cached settings instance."""
|
||||
return Settings()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user