Views
No views yet

Horologium-QwenC-1.5B is a reasoning-focused language model trained extensively on both coding and mathematics problems using reinforcement learning (RL). It is designed to provide intelligent, step-by-step solutions to structured tasks that require logical precision, algorithmic thought, and symbolic computation.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "prithivMLmods/Horologium-QwenC-1.5B"
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 = "Solve this: A function f is defined as f(x) = x^2 + 2x + 1. Find f(5) and explain the steps. Then write equivalent Python code."
13
14messages = [
15 {"role": "system", "content": "You are an expert in math and coding. Solve problems step-by-step and explain clearly."},
16 {"role": "user", "content": prompt}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True
22)
23model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
24
25generated_ids = model.generate(
26 **model_inputs,
27 max_new_tokens=512
28)
29generated_ids = [
30 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
31]
32
33response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]