Views
No views yet

transformers:pip install transformers>=4.51.01from transformers import TextStreamer
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "mii-llm/nesso-4B"
5
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype="auto",
10 device_map="auto"
11)
12
13streamer = TextStreamer(tokenizer, skip_prompt=True)
14
15messages = [
16 {"role": "system", "content": "You are a helpful assistant."},
17 {"role": "user", "content": "Write a short story about AI."}
18]
19
20text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
21inputs = tokenizer([text], return_tensors="pt").to(model.device)
22
23_ = model.generate(
24 **inputs,
25 streamer=streamer,
26 max_new_tokens=1024,
27 do_sample=True,
28 temperature=0.7,
29 top_p=0.95,
30 top_k=50
31)1pip install "vllm>=0.8.5"
2vllm serve mii-llm/nesso-4B --enable-auto-tool-choice --tool-call-parser hermes32,768 or 16,384.1# INT8
2model = AutoModelForCausalLM.from_pretrained(
3 model_name,
4 load_in_8bit=True,
5 device_map="auto"
6)
7
8# INT4
9model = AutoModelForCausalLM.from_pretrained(
10 model_name,
11 load_in_4bit=True,
12 device_map="auto"
13)1@misc{nesso-4b,
2 author = {mii-llm},
3 title = {Nesso-4B: Your Small On-Device Everyday Assistant},
4 year = {2026},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/mii-llm/nesso-4B}
7}