# FILE: modules/config_settings_public.py (Hugging Face Demo - v2.0 - Verified Models) import os import logging from huggingface_hub import hf_hub_download logger = logging.getLogger("ZOTHEOS_Config") if not logger.handlers: handler = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - [%(funcName)s] - %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.INFO) # --- ✅ VERIFIED WEB-OPTIMIZED MODEL SOURCES --- # These models are smaller, faster. MODEL_DEFINITIONS = { "mistral": { "repo_id": "TheBloke/Mistral-7B-Instruct-v0.2-GGUF", "filename": "mistral-7b-instruct-v0.2.Q2_K.gguf" # Smallest quantization for speed }, "gemma": { "repo_id": "google/gemma-2b-it-gguf", # Using the official Google repository "filename": "gemma-2b-it.gguf" }, "qwen": { "repo_id": "second-state/Qwen1.5-1.8B-Chat-GGUF", "filename": "Qwen1.5-1.8B-Chat-Q4_K_S.gguf" } } MODEL_PATHS = {} logger.info("✅✅✅ RUNNING IN WEB DEMO MODE (Hugging Face Space) ✅✅✅") N_GPU_LAYERS_FALLBACK = 0 # Force CPU-only mode for name, model_info in MODEL_DEFINITIONS.items(): logger.info(f"Downloading model for demo: {name} from {model_info['repo_id']}") try: MODEL_PATHS[name] = hf_hub_download(repo_id=model_info["repo_id"], filename=model_info["filename"]) logger.info(f"✅ Successfully downloaded {name}") except Exception as e: logger.error(f"❌ FAILED to download {name}: {e}") raise e # --- WEB-OPTIMIZED MODEL PARAMETERS --- MODEL_SPECIFIC_PARAMS = { "_default": { "n_gpu_layers": N_GPU_LAYERS_FALLBACK, "n_ctx": 2048, # Smaller context for lower RAM "n_batch": 512, "verbose": True }, "mistral": { "chat_format": "mistral-instruct" }, "gemma": { "chat_format": "gemma" }, "qwen": { "chat_format": "chatml" } } # --- AGI-TIER INFERENCE & PROMPTS --- INFERENCE_PRESETS = {"balanced": {"temperature": 0.7, "max_tokens": 512}} DEFAULT_INFERENCE_PRESET = "balanced" DEFAULT_SYSTEM_PROMPT = "You are ZOTHEOS, an ethical AI. Respond only in English." MODEL_ROLES = {"mistral": "analyst", "gemma": "humanist", "qwen": "skeptic"} MODEL_ROLE_SYSTEM_PROMPTS = { "analyst": "You are an impartial analyst. Provide structured, logical insights. Respond only in English.", "humanist": "You are an empathetic AI. Focus on the emotional and ethical impact. Respond only in English.", "skeptic": "You are a respectful skeptic. Question assumptions and highlight risks. Respond only in English.", } logger.info("✅ Hugging Face Demo Configuration Loaded Successfully.")