Skip to content

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.

fix: needle run CLI crashes on undefined args and BUF_BUCKET NameError (#86)

Pranjal Choudhury4efa4a193cb9
diff --git a/needle/model/run.py b/needle/model/run.py
index 9cc974c..eefa66d 100644
--- a/needle/model/run.py
+++ b/needle/model/run.py
@@ -11,7 +11,7 @@ from .tokenizer import get_tokenizer, BOS_ID, EOS_ID, PAD_ID
from .architecture import SimpleAttentionNetwork, TransformerConfig
CHECKPOINT_FORMAT_VERSION = 2
-
+BUF_BUCKET = 128
_decode_fn_cache = {}
@@ -216,11 +216,11 @@ def main(args):
model = SimpleAttentionNetwork(config)
tokenizer = get_tokenizer(config.vocab_size)
- prompt = args.prompt or "The most surprising thing about"
+ prompt = args.query or "The most surprising thing about"
print(f"prompt: {prompt!r}")
generate(
model, params, tokenizer, prompt,
- max_new_tokens=args.max_new_tokens,
- temperature=args.temperature,
+ max_new_tokens=args.max_len,
+ temperature=getattr(args, "temperature", 0.0),
seed=args.seed,
)