Automation foundation model for tiny devices: 2-bit, 8-29 MB, tool calls, ASR, structured extraction and embeddings on phones, wearables, smart homes, robots, cars and microcontrollers.
Update HF_REPO to point to the correct repository for Needle 2
HenryNdubuaku2e19bab90ca4
diff --git a/needle/model/architecture.py b/needle/model/architecture.pyindex c329843..e146303 100644--- a/needle/model/architecture.py+++ b/needle/model/architecture.py@@ -33,9 +33,6 @@ PRESETS = {}PRESETS["base"] = dict(d_model=512, num_heads=8, num_kv_heads=4, num_layers=27,engram_layers=(2, 15))-PRESETS["nano"] = dict(d_model=256, num_heads=4, num_kv_heads=2, num_layers=20,- vocab_size=4096, engram_layers=(2, 15), engram_slots=4096,- batch_size=256)class ZCRMSNorm(nn.Module):diff --git a/needle/model/tokenizer.py b/needle/model/tokenizer.pyindex df55296..3261a2c 100644--- a/needle/model/tokenizer.py+++ b/needle/model/tokenizer.py@@ -4,8 +4,6 @@ import sentencepiece as spmTOKENIZER_DIR = os.path.dirname(__file__)TOKENIZER_PREFIX = os.path.join(TOKENIZER_DIR, "tokenizer")-NANO_TOKENIZER_PREFIX = os.path.join(TOKENIZER_DIR, "tokenizer_nano")-NANO_VOCAB_SIZE = 4096PAD_ID = 0EOS_ID = 1@@ -30,7 +28,7 @@ IM_START_ID, IM_END_ID, THINK_START_ID, THINK_END_ID = 4, 5, 6, 7(TOOLS_START_ID, TOOLS_END_ID, TOOL_CALL_START_ID, TOOL_CALL_END_ID,TOOL_RESULT_START_ID, TOOL_RESULT_END_ID) = range(8, 14)-HF_REPO = "Cactus-Compute/needle-prod"+HF_REPO = "Cactus-Compute/needle2"_HF_TOKENIZER_DIR = "tokenizer"@@ -81,10 +79,6 @@ class SANTokenizer:return {"input_ids": all_ids}-def _prefix_for(vocab_size):- return NANO_TOKENIZER_PREFIX if vocab_size == NANO_VOCAB_SIZE else TOKENIZER_PREFIX--def _download_tokenizer_from_hf(prefix):from huggingface_hub import hf_hub_download@@ -105,7 +99,7 @@ def _download_tokenizer_from_hf(prefix):def get_tokenizer(vocab_size=None):- prefix = _prefix_for(vocab_size) if vocab_size is not None else TOKENIZER_PREFIX+ prefix = TOKENIZER_PREFIXmodel_path = prefix + ".model"if not os.path.exists(model_path):try: