Views
No views yet
Qwen3ForCausalLM).1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3repo = "littlelearner/littlelearner-5b-bounded-sft-chatty"
4tok = AutoTokenizer.from_pretrained(repo)
5model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
6msgs = [{"role": "user", "content": "If Sarah has 12 apples and gives 5 to Tom, how many does she have left?"}]
7ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
8out = model.generate(ids)
9print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))1# vLLM
2from vllm import LLM
3repo = "littlelearner/littlelearner-5b-bounded-sft-chatty"
4llm = LLM(repo)
5msgs = [{"role": "user", "content": "Liam has 3 apples and buys 4 more. How many apples does he have?"}]
6print(llm.chat(msgs)[0].outputs[0].text)