sonthaiha's picture
Final UI: Attachments, Vietnamese, Feedback
a0b166b verified
import torch
import os
class Config:
def __init__(self):
self.PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
self.DATA_DIR = os.path.join(self.PROJECT_ROOT, 'src', 'data')
# Database
raw_url = os.getenv("DATABASE_URL", "")
if raw_url.startswith("postgres://"):
self.DB_URL = raw_url.replace("postgres://", "postgresql+psycopg2://")
elif raw_url.startswith("postgresql://"):
self.DB_URL = raw_url.replace("postgresql://", "postgresql+psycopg2://")
else:
self.DB_URL = "sqlite:///:memory:"
self.DOCS_DIR = os.path.join(self.DATA_DIR, 'docs')
os.makedirs(self.DATA_DIR, exist_ok=True)
# --- LANGUAGE ENFORCEMENT ---
self.SYSTEM_CONTEXT = "Bạn là Project A, trợ lý AI chuyên về tự động hóa bán lẻ. Luôn trả lời bằng Tiếng Việt. Giọng điệu chuyên nghiệp, thân thiện."
self.model_id = "sonthaiha/project-a-14b"
self.models = { "manager": self.model_id, "coder": self.model_id, "researcher": self.model_id }
self.quantization = {
"load_in_4bit": True,
"bnb_4bit_compute_dtype": torch.float16,
"bnb_4bit_quant_type": "nf4",
"bnb_4bit_use_double_quant": True,
}
self.generation = {
"max_new_tokens": 2048,
"temperature": 0.1,
"do_sample": True
}