Views
No views yet

Gacrux-R1-Qwen3-1.7B-MoD is a high-efficiency, multi-domain model fine-tuned on Qwen3-1.7B with traces of Mixture of Domains (MoD). It leverages the prithivMLmods/Gargantua-R1-Wee dataset, designed for rigorous mathematical problem-solving and enriched with multi-domain coverage across mathematics, coding, and science. This model blends symbolic precision, scientific logic, and structured output fluency—making it an ideal tool for developers, educators, and researchers seeking advanced reasoning under constrained compute.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "prithivMLmods/Gacrux-R1-Qwen3-1.7B-MoD"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12prompt = "Explain the difference between Newtonian mechanics and quantum mechanics with examples."
13
14messages = [
15 {"role": "system", "content": "You are a scientific tutor skilled in code, math, and reasoning."},
16 {"role": "user", "content": prompt}
17]
18
19text = tokenizer.apply_chat_template(
20 messages,
21 tokenize=False,
22 add_generation_prompt=True
23)
24
25model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
26
27generated_ids = model.generate(
28 **model_inputs,
29 max_new_tokens=512
30)
31generated_ids = [
32 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
33]
34
35response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
36print(response)