Views
No views yet
SHRKLM1 deployment artifacttrust_remote_code=True. The default forward pass simulates the model's QAT
INT4 weights and dynamic INT8 activations; model.safetensors retains the
learned floating-point parameters from which that simulation is computed.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "riddhiraj/Butterfly-12M-TinyStories"
4tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
5model = AutoModelForCausalLM.from_pretrained(
6 model_id,
7 trust_remote_code=True,
8)
9
10inputs = tokenizer("Once upon a time", return_tensors="pt")
11outputs = model.generate(
12 **inputs,
13 max_new_tokens=80,
14 do_sample=True,
15 temperature=0.8,
16 top_k=20,
17)
18print(tokenizer.decode(outputs[0], skip_special_tokens=True))model.set_qat(False). That mode is
useful for comparison but does not reproduce the embedded deployment path.metrics.json and
model.manifest.json for evaluation and binary-layout details.model.bin, the 6.2 MB SHRKLM1 artifact used by
the Shrike-fi firmware. The included standalone encode_prompt.py converts text
into the serial command expected by that firmware:python encode_prompt.py --prompt "Once upon a time"p and can be pasted into the serial monitor.
The script uses only the tokenizer and configuration included in this public
model repository; it does not require the private training code.model.manifest.json records a fixed prompt and the tokens expected from greedy
decoding. This is a deterministic regression test—not a claim that the sample
is ideal or especially high quality. Matching it confirms that Transformers and
the embedded runtime are executing the packaged model consistently.other marker rather than
inventing one. TinyStories is distributed under CDLA-Sharing-1.0.