Text Classification
Transformers
English
cortex
decision-intelligence
system-1
typed-decisions
dynamic-memory
Eval Results (legacy)
Instructions to use siddiVinayaka/Cortex-System-One with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use siddiVinayaka/Cortex-System-One with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="siddiVinayaka/Cortex-System-One")# pip install -U transformers accelerate # Load model directly from transformers import Cortex model = Cortex.from_pretrained("siddiVinayaka/Cortex-System-One", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix Model import path resolution in benchmark_s1mb_official.py
Browse files- benchmark_s1mb_official.py +21 -1
benchmark_s1mb_official.py
CHANGED
|
@@ -30,10 +30,30 @@ import torch.nn.functional as F
|
|
| 30 |
import tiktoken
|
| 31 |
from datasets import load_dataset
|
| 32 |
|
|
|
|
| 33 |
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Local imports
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
EPSILON = 1e-12
|
| 39 |
|
|
|
|
| 30 |
import tiktoken
|
| 31 |
from datasets import load_dataset
|
| 32 |
|
| 33 |
+
# Add script directory, current directory, and any checkpoint parent directories to sys.path
|
| 34 |
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
| 35 |
+
sys.path.insert(0, str(Path.cwd()))
|
| 36 |
+
for arg in sys.argv:
|
| 37 |
+
try:
|
| 38 |
+
p = Path(arg).resolve()
|
| 39 |
+
if p.is_file() and (p.parent / "Model.py").is_file():
|
| 40 |
+
sys.path.insert(0, str(p.parent))
|
| 41 |
+
elif p.is_dir() and (p / "Model.py").is_file():
|
| 42 |
+
sys.path.insert(0, str(p))
|
| 43 |
+
except Exception:
|
| 44 |
+
pass
|
| 45 |
|
| 46 |
# Local imports
|
| 47 |
+
try:
|
| 48 |
+
from Model import CortexV7
|
| 49 |
+
except ImportError:
|
| 50 |
+
try:
|
| 51 |
+
from Model import Cortex as CortexV7
|
| 52 |
+
except ImportError as e:
|
| 53 |
+
raise ImportError(
|
| 54 |
+
f"Could not find Model.py in sys.path: {sys.path[:3]}. "
|
| 55 |
+
"Please ensure Model.py is in your working directory or PYTHONPATH."
|
| 56 |
+
) from e
|
| 57 |
|
| 58 |
EPSILON = 1e-12
|
| 59 |
|