Upload ZETAGRID_INFERENCE.py with huggingface_hub
Browse files- ZETAGRID_INFERENCE.py +21 -5
ZETAGRID_INFERENCE.py
CHANGED
|
@@ -21,10 +21,29 @@ print("=" * 70)
|
|
| 21 |
# CONFIG (must match training)
|
| 22 |
# ============================================================
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
GENOME_PATH = f"{BASE_DIR}/zetagrid_25b_production.npy"
|
| 26 |
DTYPE = torch.bfloat16
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
VOCAB_SIZE = 256
|
| 30 |
D_MODEL = 4096
|
|
@@ -34,9 +53,6 @@ KERNEL_SIZE = 3
|
|
| 34 |
LORA_RANK = 128
|
| 35 |
DILATION_CYCLE = [1, 2, 4, 8, 16, 32, 64, 128]
|
| 36 |
|
| 37 |
-
# Find best checkpoint
|
| 38 |
-
CKPT_DIR = f"{BASE_DIR}/phase2_checkpoints"
|
| 39 |
-
|
| 40 |
# ============================================================
|
| 41 |
# MODEL (same as training)
|
| 42 |
# ============================================================
|
|
|
|
| 21 |
# CONFIG (must match training)
|
| 22 |
# ============================================================
|
| 23 |
|
| 24 |
+
# Detect Environment: RunPod vs Local Windows
|
| 25 |
+
if os.name == 'nt':
|
| 26 |
+
print("🖥️ Running on Local Windows (E:/ZETAGRID)")
|
| 27 |
+
BASE_DIR = r"E:/ZETAGRID"
|
| 28 |
+
CKPT_DIR = BASE_DIR # Checkpoints are in root
|
| 29 |
+
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 30 |
+
else:
|
| 31 |
+
print("☁️ Running on Linux/RunPod")
|
| 32 |
+
BASE_DIR = "/workspace/zetagrid_50b"
|
| 33 |
+
# Fallback to standard check path
|
| 34 |
+
CKPT_DIR = f"{BASE_DIR}/phase2_checkpoints"
|
| 35 |
+
DEVICE = "cuda"
|
| 36 |
+
|
| 37 |
GENOME_PATH = f"{BASE_DIR}/zetagrid_25b_production.npy"
|
| 38 |
DTYPE = torch.bfloat16
|
| 39 |
+
|
| 40 |
+
# PRE-FLIGHT CHECK
|
| 41 |
+
if not os.path.exists(GENOME_PATH):
|
| 42 |
+
print(f"❌ CRITICAL ERROR: Genome file not found at {GENOME_PATH}")
|
| 43 |
+
print(" Please ensure correct path or download the model.")
|
| 44 |
+
if os.name == 'nt':
|
| 45 |
+
print(" On Windows, ensure E:/ZETAGRID is mounted/accessible.")
|
| 46 |
+
exit(1)
|
| 47 |
|
| 48 |
VOCAB_SIZE = 256
|
| 49 |
D_MODEL = 4096
|
|
|
|
| 53 |
LORA_RANK = 128
|
| 54 |
DILATION_CYCLE = [1, 2, 4, 8, 16, 32, 64, 128]
|
| 55 |
|
|
|
|
|
|
|
|
|
|
| 56 |
# ============================================================
|
| 57 |
# MODEL (same as training)
|
| 58 |
# ============================================================
|