siddiVinayaka commited on
Commit
3700a6f
·
verified ·
1 Parent(s): d31ea88

Enable 1-click snapshot_download Quickstart in README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -19
README.md CHANGED
@@ -105,30 +105,27 @@ Unlike traditional models trained on 2–15 Trillion tokens of uncurated web cra
105
 
106
  ## Quickstart & Inference
107
 
108
- ```bash
109
- # Ensure Git LFS is active to pull the 2.21 GB model weights
110
- git lfs install
111
- git clone https://huggingface.co/siddiVinayaka/Cortex-System-One
112
- cd Cortex-System-One
113
- git lfs pull
114
 
115
- pip install torch tiktoken huggingface_hub
116
- ```
117
 
118
  ```python
119
- import torch
120
- from Model import Cortex
121
- from inference import load_cortex_model, predict_choice
 
 
 
 
 
 
 
 
122
 
123
- # 1. Load Model & Calibration
124
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
125
- model, calibration = load_cortex_model(
126
- checkpoint_path="ckpt_cortex_system_one_champion.pth",
127
- calibration_path="cortex_system_one_calibration.json",
128
- device=device
129
- )
130
 
131
- # 2. Run Inference
132
  prompt = (
133
  "Workflow: Security Incidents\n"
134
  "Task State: {\"alert_type\":\"brute_force\",\"failed_logins\":42,\"source_ip\":\"198.51.100.2\"}\n\n"
@@ -145,11 +142,20 @@ options = [
145
  "Send non-urgent notification"
146
  ]
147
 
148
- result = predict_choice(model, prompt, options, calibration=calibration, device=device)
149
  print(f"Decision: {result['predicted_option']}")
150
  print(f"Confidence: {result['probabilities']}")
151
  ```
152
 
 
 
 
 
 
 
 
 
 
153
  ---
154
 
155
  ## License & Usage Restrictions
 
105
 
106
  ## Quickstart & Inference
107
 
108
+ ### 1. In Google Colab or Python (1-Click, Zero Git Clone)
 
 
 
 
 
109
 
110
+ You can run Cortex-System-One directly in Python or a Google Colab notebook using `huggingface_hub` — **no `git clone` or `git lfs` needed**:
 
111
 
112
  ```python
113
+ # Install dependencies
114
+ !pip install -q torch tiktoken huggingface_hub
115
+
116
+ # Load model directly from Hugging Face repository
117
+ import sys, torch
118
+ from huggingface_hub import snapshot_download
119
+
120
+ model_dir = snapshot_download("siddiVinayaka/Cortex-System-One")
121
+ sys.path.append(model_dir)
122
+
123
+ from inference import load_cortex_model, predict_decision
124
 
 
125
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
126
+ model, calibration = load_cortex_model(model_dir, device=device)
 
 
 
 
127
 
128
+ # Run Inference
129
  prompt = (
130
  "Workflow: Security Incidents\n"
131
  "Task State: {\"alert_type\":\"brute_force\",\"failed_logins\":42,\"source_ip\":\"198.51.100.2\"}\n\n"
 
142
  "Send non-urgent notification"
143
  ]
144
 
145
+ result = predict_decision(model, prompt, options, calibration=calibration, device=device)
146
  print(f"Decision: {result['predicted_option']}")
147
  print(f"Confidence: {result['probabilities']}")
148
  ```
149
 
150
+ ### 2. Local Machine via Git
151
+
152
+ ```bash
153
+ git clone https://huggingface.co/siddiVinayaka/Cortex-System-One
154
+ cd Cortex-System-One
155
+ pip install -r requirements.txt # or: pip install torch tiktoken
156
+ python inference.py
157
+ ```
158
+
159
  ---
160
 
161
  ## License & Usage Restrictions