Views
No views yet
Qwen/Qwen3-0.6B specialized for Python code generation tasks. It's designed to understand programming-related instructions and provide accurate and efficient Python code solutions.Qwen/Qwen3-0.6BTokenBender/code_instructions_122k_alpaca_style - A large dataset of coding instructions and their corresponding solutions.transformers1from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
2import torch
3
4model_id = "rohitnagareddy/Qwen3-0.6B-Coding-Finetuned-v1"
5
6# Load model and tokenizer
7tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 torch_dtype=torch.float16,
11 device_map="auto",
12 trust_remote_code=True
13)
14
15# Create conversation for a Python code-generation task
16messages = [
17 {"role": "system", "content": "You are an expert coding assistant."},
18 {"role": "user", "content": "Write a Python function that takes a list of integers and returns the sum of all even numbers in the list."}
19]
20prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
21
22pipe = pipeline(
23 "text-generation",
24 model=model,
25 tokenizer=tokenizer
26)
27
28# Generate response
29outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
30print(outputs[0]["generated_text"])llama.cpp and compatible tools:Qwen3-0.6B-Coding-Finetuned-v1.fp16.gguf - Full precision (largest, best quality)Qwen3-0.6B-Coding-Finetuned-v1.Q8_0.gguf - 8-bit quantization (good balance)Qwen3-0.6B-Coding-Finetuned-v1.Q5_K_M.gguf - 5-bit quantization (smaller, fast)Qwen3-0.6B-Coding-Finetuned-v1.Q4_K_M.gguf - 4-bit quantization (smallest, fastest)./main -m ./Qwen3-0.6B-Coding-Finetuned-v1.Q4_K_M.gguf -n 256 -p "<|im_start|>system\nYou are an expert coding assistant.<|im_end|>\n<|im_start|>user\nCreate a Python function to find the factorial of a number.<|im_end|>\n<|im_start|>assistant\n"