File size: 1,345 Bytes
438787b
 
 
bd00f64
 
 
 
 
 
438787b
 
3b4cb5c
438787b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""LemonSeed 1.5B — minimal generation template.

LemonSeed is a custom hybrid (Gated-DeltaNet + attention + MoE + Mixture-of-Depths)
architecture and is NOT loadable via `transformers`.

Primary engine (C++/ROCm):  https://github.com/Geramy/LSE
Reference docs:             https://github.com/Geramy/lemonseed-docs

This file is the simple MLX reference path (needs the lemonseed Python model code).

    pip install mlx fastokens huggingface_hub
    git clone https://github.com/Geramy/lemonseed-docs && cd lemonseed

Then download this repo's files (model.safetensors, config.json, tokenizer.json)
next to each other and run:

    python example_generate.py
"""
import sys
sys.path.insert(0, ".")  # so `lemonseed` package is importable

from lemonseed.model import load_model
from lemonseed.tokenizer import load_tokenizer
from lemonseed.generate import generate_text

MODEL = "model.safetensors"   # config.json must sit alongside it

model = load_model(MODEL)
tok = load_tokenizer("qwen3.6")   # uses the Qwen3.6 tokenizer (bundled tokenizer.json)

PROMPTS = [
    "The capital of France is",
    "def fibonacci(n):",
    "Question: What is 8 × 6?\nLet's think step by step.\nAnswer:",
    "Once upon a time",
]

for p in PROMPTS:
    out = generate_text(model, tok, p, max_new_tokens=64, greedy=True)
    print("=" * 60)
    print(out)