Views
No views yet

1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "NousResearch/nomos-1"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.float16,
10 device_map="auto",
11 trust_remote_code=True,
12)
13
14messages = [
15 {
16 "role": "user",
17 "content": (
18 "Solve the following problem and show your reasoning:\n\n"
19 "Let a, b, c be positive real numbers such that abc = 1. "
20 "Prove that\n"
21 "\\[\n"
22 " \\frac{1}{1+a} + \\frac{1}{1+b} + \\frac{1}{1+c} \\ge 1.\n"
23 "\\]"
24 ),
25 },
26]
27
28inputs = tokenizer.apply_chat_template(
29 messages,
30 add_generation_prompt=True,
31 return_tensors="pt",
32).to(model.device)
33
34with torch.no_grad():
35 outputs = model.generate(
36 **inputs,
37 max_new_tokens=400,
38 temperature=0.6,
39 top_p=0.95,
40 top_k=20,
41 do_sample=True,
42 )
43
44print(tokenizer.decode(outputs[0], skip_special_tokens=True))python -m sglang.launch_server \
--model-path NousResearch/nomos-1 \
--tp-size 8vllm serve \
--model NousResearch/nomos-1 \
--tensor-parallel-size 8@misc{nomos_model2025,
title = {Nomos Model},
author = {Jin, Roger and Quesnelle, Jeffrey and Mahan, Dakota and Guang, Chen and Teknium, Ryan and Park, Jun and Ustelbay, Ibrakhim and Kim, Samuel and Yurkevich, Miron and Zauytkhan, Adilet and Amankos, Rinat and Andreyev, Alex and Nurlanov, Damir and Abuov, Abuzer and massiveaxe, Askar},
year = {2025},
howpublished = {\url{https://huggingface.co/NousResearch/nomos-1}},
note = {Model release},
}