Spaces:
Runtime error
Runtime error
syntacx fix
Browse files- AICoreAGIX_with_TB.py +10 -1
AICoreAGIX_with_TB.py
CHANGED
|
@@ -41,7 +41,16 @@ class AICoreAGIX:
|
|
| 41 |
self.failsafe_system = AIFailsafeSystem()
|
| 42 |
self.config = self._load_config(config_path)
|
| 43 |
self._load_or_generate_id_lock()
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
self.model = AutoModelForCausalLM.from_pretrained(self.config["model_name"])
|
| 46 |
self.context_memory = self._initialize_vector_memory()
|
| 47 |
self.http_session = aiohttp.ClientSession()
|
|
|
|
| 41 |
self.failsafe_system = AIFailsafeSystem()
|
| 42 |
self.config = self._load_config(config_path)
|
| 43 |
self._load_or_generate_id_lock()
|
| 44 |
+
try:
|
| 45 |
+
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 46 |
+
self.config["model_name"],
|
| 47 |
+
trust_remote_code=True,
|
| 48 |
+
use_fast=False
|
| 49 |
+
)
|
| 50 |
+
except KeyError as e:
|
| 51 |
+
l ogger.warning(f"[Tokenizer Load]: Fallback triggered due to missing config key: {e}")
|
| 52 |
+
self.tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
| 53 |
+
|
| 54 |
self.model = AutoModelForCausalLM.from_pretrained(self.config["model_name"])
|
| 55 |
self.context_memory = self._initialize_vector_memory()
|
| 56 |
self.http_session = aiohttp.ClientSession()
|