Views
No views yet
-ku, -ću, -tku).DakotaGrammarRubric) with the following components:i55d4x26)1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model_name = "Qwen/Qwen3-30B-A3B-Instruct-2507"
5adapter_name = "HarleyCooper/Qwen3-30B-ThinkingMachines-Dakota1890"
6
7model = AutoModelForCausalLM.from_pretrained(
8 base_model_name,
9 device_map="auto",
10 torch_dtype="auto",
11 trust_remote_code=True,
12)
13tokenizer = AutoTokenizer.from_pretrained(base_model_name)
14model = PeftModel.from_pretrained(model, adapter_name)
15
16# Inference
17prompt = "Translate 'my elder brother' to Dakota using the correct possessive suffix."
18messages = [
19 {"role": "system", "content": "You are a Dakota language expert."},
20 {"role": "user", "content": prompt}
21]
22text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
23inputs = tokenizer(text, return_tensors="pt").to(model.device)
24
25outputs = model.generate(**inputs, max_new_tokens=128)
26print(tokenizer.decode(outputs[0], skip_special_tokens=True))
27
28# Alternatively:
29# from peft import AutoPeftModelForCausalLM
30# model = AutoPeftModelForCausalLM.from_pretrained(adapter_name, device_map="auto")tinker://da1ef918-d67a-5080-b500-dd1256db9ca7:train:0/sampler_weights/finaladapter_model.safetensors: The LoRA adapter weights.adapter_config.json: Adapter configuration.tinker_metadata.json: Metadata from the Thinking Machines training run.Riggs, S. R. (1890). Dakota Grammar, Texts, and Ethnography. Washington: Government Printing Office.