Views
No views yet
deepreinforce-ai/Ornith-1.0-35B.deepreinforce-ai/Ornith-1.0-35B1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "almernzh/Ornith-1.0-35B-BNB-NF4"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 trust_remote_code=True,
11)
12
13messages = [
14 {
15 "role": "user",
16 "content": "Give a concise plan to debug a failing Python unit test.",
17 }
18]
19
20text = tokenizer.apply_chat_template(
21 messages,
22 tokenize=False,
23 add_generation_prompt=True,
24)
25
26inputs = tokenizer(text, return_tensors="pt").to(model.device)
27
28with torch.no_grad():
29 output = model.generate(
30 **inputs,
31 max_new_tokens=200,
32 temperature=0.6,
33 top_p=0.95,
34 )
35
36print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))<think>...</think> block before the final answer. This follows the behavior of the base model.