Update app.py
Browse files
app.py
CHANGED
|
@@ -2299,6 +2299,25 @@ def predict(message, history, max_new_tokens):
|
|
| 2299 |
global last_conversation
|
| 2300 |
|
| 2301 |
# EVE API INTEGRATION - DUAL RESONANCE MODE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2302 |
eve_only_triggers = [
|
| 2303 |
"lets ask eve", "let's ask eve", "ask eve", "consult eve",
|
| 2304 |
"query eve", "get eve's input", "tell eve", "message eve",
|
|
|
|
| 2299 |
global last_conversation
|
| 2300 |
|
| 2301 |
# EVE API INTEGRATION - DUAL RESONANCE MODE
|
| 2302 |
+
if torch.cuda.is_available():
|
| 2303 |
+
try:
|
| 2304 |
+
print("[ADAM] Moving models to GPU...")
|
| 2305 |
+
model.to("cuda")
|
| 2306 |
+
librarian_model.to("cuda")
|
| 2307 |
+
navigator.device = "cuda"
|
| 2308 |
+
navigator.manifold = navigator.manifold.to("cuda") # Ensure manifold is on GPU
|
| 2309 |
+
|
| 2310 |
+
# Ensure state tensors are on GPU
|
| 2311 |
+
if hasattr(navigator, 'current_psyche_coord'):
|
| 2312 |
+
navigator.current_psyche_coord = navigator.current_psyche_coord.to("cuda")
|
| 2313 |
+
|
| 2314 |
+
# Clear basis cache to ensure regeneration on GPU (prevents CPU/GPU mismatch)
|
| 2315 |
+
navigator.frequencies = {}
|
| 2316 |
+
navigator.phases = {}
|
| 2317 |
+
|
| 2318 |
+
except Exception as e:
|
| 2319 |
+
print(f"[ADAM] Warning: Failed to move models to GPU: {e}")
|
| 2320 |
+
|
| 2321 |
eve_only_triggers = [
|
| 2322 |
"lets ask eve", "let's ask eve", "ask eve", "consult eve",
|
| 2323 |
"query eve", "get eve's input", "tell eve", "message eve",
|