Views
No views yet

| Model | Score |
|---|---|
| khazarai/Qwen3-4B-Qwen3.6-plus-Reasoning-Distilled | 75.64 |
| Qwen/Qwen3-4B-Thinking-2507 | 73.73 |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("khazarai/Qwen3-4B-Qwen3.6-plus-Reasoning-Distilled")
4model = AutoModelForCausalLM.from_pretrained(
5 "khazarai/Qwen3-4B-Qwen3.6-plus-Reasoning-Distilled",
6 device_map={"": 0}
7)
8
9question = """
10You are given a directed graph with N nodes and M edges, where each edge has a weight. You need to find the shortest path from node 1 to node N, but with a twist: you are allowed to reverse at most K edges (changing their direction) during your journey. The cost of reversing an edge is equal to its original weight. Design an efficient algorithm to solve this problem and analyze its time and space complexity. Consider both the case where K is small (K <= 5) and where K is large (K >= N/2).
11"""
12
13messages = [
14 {"role" : "user", "content" : question}
15]
16text = tokenizer.apply_chat_template(
17 messages,
18 tokenize = False,
19 add_generation_prompt = True,
20 enable_thinking = True,
21)
22
23from transformers import TextStreamer
24_ = model.generate(
25 **tokenizer(text, return_tensors = "pt").to("cuda"),
26 max_new_tokens = 4048,
27 temperature = 0.6,
28 top_p = 0.95,
29 top_k = 20,
30 streamer = TextStreamer(tokenizer, skip_prompt = True),
31)