|
from dataclasses import dataclass |
|
import os |
|
|
|
|
|
@dataclass |
|
class WebConfigs: |
|
""" |
|
项目所有的配置 |
|
""" |
|
|
|
|
|
|
|
|
|
if os.getenv("USING_4BIT") == "true": |
|
LLM_MODEL_NAME: str = "HinGwenWoong/streamer-sales-lelemiao-7b-4bit" |
|
else: |
|
LLM_MODEL_NAME: str = "HinGwenWoong/streamer-sales-lelemiao-7b" |
|
|
|
SALES_NAME: str = "智能医导小助手" |
|
|
|
LLM_MODEL_DIR: str = r"./weights/llm_weights/" |
|
|
|
|
|
|
|
|
|
ENABLE_RAG: bool = True |
|
ENABLE_TTS: bool = True |
|
ENABLE_DIGITAL_HUMAN: bool = True |
|
ENABLE_AGENT: bool = os.environ.get("ENABLE_AGENT", "true") == "true" |
|
ENABLE_ASR: bool = os.environ.get("ENABLE_ASR", "true") == "true" |
|
|
|
DISABLE_UPLOAD: bool = os.getenv("DISABLE_UPLOAD") == "true" |
|
|
|
CACHE_MAX_ENTRY_COUNT: float = float( |
|
os.environ.get("KV_CACHE", 0.1) |
|
) |
|
|
|
|
|
|
|
|
|
PRODUCT_IMAGE_HEIGHT: int = 400 |
|
EACH_CARD_OFFSET: int = 100 |
|
EACH_ROW_COL: int = 2 |
|
|
|
|
|
USER_AVATOR: str = "./assets/user.png" |
|
ROBOT_AVATOR: str = "./assets/logo.png" |
|
|
|
|
|
|
|
|
|
PRODUCT_INSTRUCTION_DIR: str = r"./product_info/instructions" |
|
PRODUCT_IMAGES_DIR: str = r"./product_info/images" |
|
|
|
PRODUCT_INFO_YAML_PATH: str = r"./product_info/product_info.yaml" |
|
PRODUCT_INFO_YAML_BACKUP_PATH: str = PRODUCT_INFO_YAML_PATH + ".bk" |
|
|
|
|
|
|
|
|
|
CONVERSATION_CFG_YAML_PATH: str = r"./configs/conversation_cfg.yaml" |
|
|
|
|
|
|
|
|
|
RAG_CONFIG_PATH: str = r"./configs/rag_config.yaml" |
|
RAG_VECTOR_DB_DIR: str = r"./work_dirs/instruction_db" |
|
PRODUCT_INSTRUCTION_DIR_GEN_DB_TMP: str = r"./work_dirs/instructions_gen_db_tmp" |
|
RAG_MODEL_DIR: str = r"./weights/rag_weights/" |
|
|
|
|
|
|
|
|
|
TTS_WAV_GEN_PATH: str = r"./work_dirs/tts_wavs" |
|
TTS_MODEL_DIR: str = r"./weights/gpt_sovits_weights/" |
|
|
|
|
|
|
|
|
|
DIGITAL_HUMAN_GEN_PATH: str = r"./work_dirs/digital_human" |
|
DIGITAL_HUMAN_MODEL_DIR: str = r"./weights/digital_human_weights/" |
|
DIGITAL_HUMAN_BBOX_SHIFT: int = 0 |
|
DIGITAL_HUMAN_VIDEO_PATH: str = r"./doc/digital_human/digital_human_video.mp4" |
|
|
|
DIGITAL_HUMAN_FPS: int = 25 |
|
|
|
|
|
|
|
AGENT_WEATHER_API_KEY: str | None = os.environ.get("WEATHER_API_KEY", None) |
|
AGENT_DELIVERY_TIME_API_KEY: str | None = os.environ.get("DELIVERY_TIME_API_KEY", None) |
|
|
|
|
|
|
|
|
|
ASR_WAV_SAVE_PATH: str = r"./work_dirs/asr_wavs" |
|
ASR_MODEL_DIR: str = r"./weights/asr_weights/" |
|
|
|
|
|
|
|
WEB_CONFIGS = WebConfigs() |
|
|