Spaces:
Running
Running
Update modules/config_settings_public.py
Browse files
modules/config_settings_public.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# FILE: modules/config_settings_public.py (
|
2 |
|
3 |
import os
|
4 |
import sys
|
@@ -15,12 +15,22 @@ if not logger.handlers:
|
|
15 |
|
16 |
IS_WEB_MODE = os.path.exists("/home/user/app")
|
17 |
|
|
|
18 |
MODEL_DEFINITIONS = {
|
19 |
"mistral": {
|
20 |
"repo_id": "TheBloke/Mistral-7B-Instruct-v0.2-GGUF",
|
21 |
"filename": "mistral-7b-instruct-v0.2.Q4_K_M.gguf"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
}
|
|
|
24 |
MODEL_PATHS = {}
|
25 |
|
26 |
if IS_WEB_MODE:
|
@@ -34,7 +44,7 @@ if IS_WEB_MODE:
|
|
34 |
except Exception as e:
|
35 |
logger.error(f"β FAILED to download model {name}. Error: {e}")
|
36 |
raise e
|
37 |
-
else:
|
38 |
logger.info("β
β
β
RUNNING IN LOCAL MODE (Desktop/PC) β
β
β
")
|
39 |
APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
40 |
BASE_MODELS_DIR = os.path.join(APP_DIR, "models")
|
@@ -42,30 +52,45 @@ else:
|
|
42 |
MODEL_PATHS[name] = os.path.join(BASE_MODELS_DIR, model_info["filename"])
|
43 |
N_GPU_LAYERS_FALLBACK = -1
|
44 |
|
45 |
-
# ---
|
46 |
MAX_RAM_MODELS_GB = 23.8
|
47 |
-
MAX_CONCURRENT_MODELS =
|
48 |
N_CTX_FALLBACK = 2048
|
49 |
VERBOSE_LLAMA_CPP = True
|
|
|
50 |
MODEL_SPECIFIC_PARAMS = {
|
51 |
"_default": {
|
52 |
"n_gpu_layers": N_GPU_LAYERS_FALLBACK, "n_ctx": N_CTX_FALLBACK, "f16_kv": True,
|
53 |
"use_mmap": True, "verbose": VERBOSE_LLAMA_CPP
|
54 |
},
|
55 |
-
"mistral": {"chat_format": "mistral-instruct"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
-
INFERENCE_PRESETS = { "balanced": {"temperature": 0.7, "top_p": 0.9, "max_tokens": 1024} }
|
58 |
DEFAULT_INFERENCE_PRESET = "balanced"
|
59 |
-
DEFAULT_SYSTEM_PROMPT = "You are ZOTHEOS, an ethical AI developed to help humanity."
|
60 |
-
MODEL_ROLES = {"mistral": "analyst"}
|
61 |
-
MODEL_ROLE_SYSTEM_PROMPTS = {"analyst": "You are an impartial analyst.", "general": DEFAULT_SYSTEM_PROMPT}
|
62 |
|
63 |
-
|
64 |
SYSTEM_PERSONAS = {
|
65 |
"default": DEFAULT_SYSTEM_PROMPT,
|
66 |
"helpful_assistant": "You are a helpful AI assistant.",
|
67 |
"philosopher": "You are an AI philosopher.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
-
ZOTHEOS_VERSION = "3.
|
71 |
logger.info(f"Config loaded. Version: {ZOTHEOS_VERSION}, Web Mode: {IS_WEB_MODE}")
|
|
|
1 |
+
# FILE: modules/config_settings_public.py (True Fusion, 3-Model, Verified)
|
2 |
|
3 |
import os
|
4 |
import sys
|
|
|
15 |
|
16 |
IS_WEB_MODE = os.path.exists("/home/user/app")
|
17 |
|
18 |
+
# --- β
β
β
100% VERIFIED REPOSITORY AND FILENAMES FOR ALL 3 MODELS β
β
β
---
|
19 |
MODEL_DEFINITIONS = {
|
20 |
"mistral": {
|
21 |
"repo_id": "TheBloke/Mistral-7B-Instruct-v0.2-GGUF",
|
22 |
"filename": "mistral-7b-instruct-v0.2.Q4_K_M.gguf"
|
23 |
+
},
|
24 |
+
"gemma": {
|
25 |
+
"repo_id": "TheBloke/Gemma-2B-IT-GGUF", # Correct, verified repo ID
|
26 |
+
"filename": "gemma-2b-it.Q4_K_M.gguf"
|
27 |
+
},
|
28 |
+
"qwen": {
|
29 |
+
"repo_id": "TheBloke/Qwen1.5-1.8B-Chat-GGUF",
|
30 |
+
"filename": "qwen1.5-1.8b-chat.Q4_K_M.gguf"
|
31 |
}
|
32 |
}
|
33 |
+
|
34 |
MODEL_PATHS = {}
|
35 |
|
36 |
if IS_WEB_MODE:
|
|
|
44 |
except Exception as e:
|
45 |
logger.error(f"β FAILED to download model {name}. Error: {e}")
|
46 |
raise e
|
47 |
+
else: # LOCAL MODE
|
48 |
logger.info("β
β
β
RUNNING IN LOCAL MODE (Desktop/PC) β
β
β
")
|
49 |
APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
50 |
BASE_MODELS_DIR = os.path.join(APP_DIR, "models")
|
|
|
52 |
MODEL_PATHS[name] = os.path.join(BASE_MODELS_DIR, model_info["filename"])
|
53 |
N_GPU_LAYERS_FALLBACK = -1
|
54 |
|
55 |
+
# --- Full-Featured Configurations ---
|
56 |
MAX_RAM_MODELS_GB = 23.8
|
57 |
+
MAX_CONCURRENT_MODELS = 3
|
58 |
N_CTX_FALLBACK = 2048
|
59 |
VERBOSE_LLAMA_CPP = True
|
60 |
+
|
61 |
MODEL_SPECIFIC_PARAMS = {
|
62 |
"_default": {
|
63 |
"n_gpu_layers": N_GPU_LAYERS_FALLBACK, "n_ctx": N_CTX_FALLBACK, "f16_kv": True,
|
64 |
"use_mmap": True, "verbose": VERBOSE_LLAMA_CPP
|
65 |
},
|
66 |
+
"mistral": {"chat_format": "mistral-instruct"},
|
67 |
+
"gemma": {"chat_format": "gemma"},
|
68 |
+
"qwen": {"chat_format": "chatml"}
|
69 |
+
}
|
70 |
+
|
71 |
+
INFERENCE_PRESETS = {
|
72 |
+
"balanced": {"temperature": 0.7, "top_p": 0.9, "top_k": 40, "repeat_penalty": 1.1, "max_tokens": 1024},
|
73 |
+
"precise": {"temperature": 0.2, "top_p": 0.7, "top_k": 20, "repeat_penalty": 1.05, "max_tokens": 1536},
|
74 |
+
"creative": {"temperature": 0.9, "top_p": 0.95, "top_k": 60, "repeat_penalty": 1.15, "max_tokens": 1024}
|
75 |
}
|
|
|
76 |
DEFAULT_INFERENCE_PRESET = "balanced"
|
|
|
|
|
|
|
77 |
|
78 |
+
DEFAULT_SYSTEM_PROMPT = "You are ZOTHEOS, an ethical AI developed to help humanity."
|
79 |
SYSTEM_PERSONAS = {
|
80 |
"default": DEFAULT_SYSTEM_PROMPT,
|
81 |
"helpful_assistant": "You are a helpful AI assistant.",
|
82 |
"philosopher": "You are an AI philosopher.",
|
83 |
+
"coder": "You are an expert AI programmer.",
|
84 |
+
"concise_summarizer": "You are an AI tasked with providing very concise summaries."
|
85 |
+
}
|
86 |
+
|
87 |
+
MODEL_ROLES = {"mistral": "analyst", "gemma": "humanist", "qwen": "skeptic"}
|
88 |
+
MODEL_ROLE_SYSTEM_PROMPTS = {
|
89 |
+
"analyst": "You are an impartial analyst. Focus on facts, clarity, and cause-effect logic. Provide structured, evidence-based reasoning.",
|
90 |
+
"humanist": "You are a human-centered assistant. Focus on emotion, empathy, ethical considerations, and the potential human impact or experience related to the query.",
|
91 |
+
"skeptic": "You are a critical evaluator and a respectful skeptic. Your role is to challenge assumptions, highlight potential risks, point out biases, and explore alternative or less obvious interpretations. Question the premises if necessary.",
|
92 |
+
"general": DEFAULT_SYSTEM_PROMPT
|
93 |
}
|
94 |
|
95 |
+
ZOTHEOS_VERSION = "3.2 (True Fusion Verified)"
|
96 |
logger.info(f"Config loaded. Version: {ZOTHEOS_VERSION}, Web Mode: {IS_WEB_MODE}")
|