Spaces:
Sleeping
Sleeping
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 (Final
|
2 |
|
3 |
import os
|
4 |
import sys
|
@@ -23,7 +23,7 @@ MODEL_DEFINITIONS = {
|
|
23 |
"filename": "mistral-7b-instruct-v0.2.Q4_K_M.gguf"
|
24 |
},
|
25 |
"gemma": {
|
26 |
-
"repo_id": "google/gemma-2b-it-gguf", #
|
27 |
"filename": "gemma-2b-it.Q4_K_M.gguf"
|
28 |
},
|
29 |
"qwen": {
|
@@ -44,11 +44,9 @@ if IS_WEB_MODE:
|
|
44 |
logger.info(f"Downloading model: {name} from repo: {model_info['repo_id']}")
|
45 |
try:
|
46 |
MODEL_PATHS[name] = hf_hub_download(repo_id=model_info["repo_id"], filename=model_info["filename"])
|
47 |
-
logger.info(f"Successfully downloaded {name}.")
|
48 |
except Exception as e:
|
49 |
logger.error(f"β FAILED to download model {name}. Error: {e}")
|
50 |
-
# To prevent the app from crashing, you might want to handle this gracefully
|
51 |
-
# For now, we'll let it raise the error so you see it in the logs.
|
52 |
raise e
|
53 |
|
54 |
N_GPU_LAYERS_FALLBACK = 0
|
@@ -56,18 +54,11 @@ if IS_WEB_MODE:
|
|
56 |
|
57 |
else: # LOCAL MODE
|
58 |
logger.info("β
β
β
RUNNING IN LOCAL MODE (Desktop/PC) β
β
β
")
|
59 |
-
|
60 |
-
if _is_frozen:
|
61 |
-
APP_DIR = os.path.dirname(sys.executable)
|
62 |
-
else:
|
63 |
-
APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
64 |
-
|
65 |
BASE_MODELS_DIR = os.path.join(APP_DIR, "models")
|
66 |
logger.info(f"Models will be loaded from local directory: {BASE_MODELS_DIR}")
|
67 |
-
|
68 |
for name, model_info in MODEL_DEFINITIONS.items():
|
69 |
MODEL_PATHS[name] = os.path.join(BASE_MODELS_DIR, model_info["filename"])
|
70 |
-
|
71 |
N_GPU_LAYERS_FALLBACK = -1
|
72 |
logger.info("N_GPU_LAYERS_FALLBACK set to -1 for local GPU acceleration.")
|
73 |
|
@@ -100,32 +91,17 @@ INFERENCE_PRESETS = {
|
|
100 |
}
|
101 |
DEFAULT_INFERENCE_PRESET = "balanced"
|
102 |
|
103 |
-
# --- System Prompts and Personas ---
|
104 |
DEFAULT_SYSTEM_PROMPT = "You are ZOTHEOS, an ethical AI developed to help humanity. Provide clear, concise, and helpful responses. Be respectful and avoid harmful content."
|
105 |
-
|
106 |
SYSTEM_PERSONAS = {
|
107 |
-
"default": DEFAULT_SYSTEM_PROMPT,
|
108 |
-
"
|
109 |
-
"philosopher": "You are an AI philosopher. Engage with complex questions thoughtfully and explore different perspectives.",
|
110 |
-
"coder": "You are an expert AI programmer. Provide code examples and explain them clearly. Assume a senior developer audience.",
|
111 |
-
"concise_summarizer": "You are an AI tasked with providing very concise summaries. Get straight to the point. Use bullet points where appropriate.",
|
112 |
}
|
113 |
-
|
114 |
-
# --- Model Roles and System Prompts for TrueFusion ---
|
115 |
-
MODEL_ROLES = {
|
116 |
-
"mistral": "analyst",
|
117 |
-
"gemma": "humanist",
|
118 |
-
"qwen": "skeptic",
|
119 |
-
}
|
120 |
-
|
121 |
MODEL_ROLE_SYSTEM_PROMPTS = {
|
122 |
-
"analyst": "You are an impartial analyst.
|
123 |
-
"
|
124 |
-
"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.",
|
125 |
-
"general": DEFAULT_SYSTEM_PROMPT
|
126 |
}
|
127 |
|
128 |
-
|
129 |
-
ZOTHEOS_VERSION = "Public Beta 1.7 (Web Live)"
|
130 |
logger.info(f"Config settings loaded. Version: {ZOTHEOS_VERSION}")
|
131 |
logger.info(f"Web Mode: {IS_WEB_MODE}")
|
|
|
1 |
+
# FILE: modules/config_settings_public.py (Definitive Final Version)
|
2 |
|
3 |
import os
|
4 |
import sys
|
|
|
23 |
"filename": "mistral-7b-instruct-v0.2.Q4_K_M.gguf"
|
24 |
},
|
25 |
"gemma": {
|
26 |
+
"repo_id": "google/gemma-2b-it-gguf", # β
β
β
THE ONLY CHANGE IS THIS LINE (GGUF -> gguf) β
β
β
|
27 |
"filename": "gemma-2b-it.Q4_K_M.gguf"
|
28 |
},
|
29 |
"qwen": {
|
|
|
44 |
logger.info(f"Downloading model: {name} from repo: {model_info['repo_id']}")
|
45 |
try:
|
46 |
MODEL_PATHS[name] = hf_hub_download(repo_id=model_info["repo_id"], filename=model_info["filename"])
|
47 |
+
logger.info(f"β
Successfully downloaded {name}.")
|
48 |
except Exception as e:
|
49 |
logger.error(f"β FAILED to download model {name}. Error: {e}")
|
|
|
|
|
50 |
raise e
|
51 |
|
52 |
N_GPU_LAYERS_FALLBACK = 0
|
|
|
54 |
|
55 |
else: # LOCAL MODE
|
56 |
logger.info("β
β
β
RUNNING IN LOCAL MODE (Desktop/PC) β
β
β
")
|
57 |
+
APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
|
58 |
BASE_MODELS_DIR = os.path.join(APP_DIR, "models")
|
59 |
logger.info(f"Models will be loaded from local directory: {BASE_MODELS_DIR}")
|
|
|
60 |
for name, model_info in MODEL_DEFINITIONS.items():
|
61 |
MODEL_PATHS[name] = os.path.join(BASE_MODELS_DIR, model_info["filename"])
|
|
|
62 |
N_GPU_LAYERS_FALLBACK = -1
|
63 |
logger.info("N_GPU_LAYERS_FALLBACK set to -1 for local GPU acceleration.")
|
64 |
|
|
|
91 |
}
|
92 |
DEFAULT_INFERENCE_PRESET = "balanced"
|
93 |
|
|
|
94 |
DEFAULT_SYSTEM_PROMPT = "You are ZOTHEOS, an ethical AI developed to help humanity. Provide clear, concise, and helpful responses. Be respectful and avoid harmful content."
|
|
|
95 |
SYSTEM_PERSONAS = {
|
96 |
+
"default": DEFAULT_SYSTEM_PROMPT, "helpful_assistant": "You are a helpful AI assistant.", "philosopher": "You are an AI philosopher.",
|
97 |
+
"coder": "You are an expert AI programmer.", "concise_summarizer": "You are an AI tasked with providing very concise summaries."
|
|
|
|
|
|
|
98 |
}
|
99 |
+
MODEL_ROLES = {"mistral": "analyst", "gemma": "humanist", "qwen": "skeptic"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
MODEL_ROLE_SYSTEM_PROMPTS = {
|
101 |
+
"analyst": "You are an impartial analyst.", "humanist": "You are a human-centered assistant.",
|
102 |
+
"skeptic": "You are a critical evaluator and a respectful skeptic.", "general": DEFAULT_SYSTEM_PROMPT
|
|
|
|
|
103 |
}
|
104 |
|
105 |
+
ZOTHEOS_VERSION = "Public Beta 1.8 (Live)"
|
|
|
106 |
logger.info(f"Config settings loaded. Version: {ZOTHEOS_VERSION}")
|
107 |
logger.info(f"Web Mode: {IS_WEB_MODE}")
|