πŸ’» Qwen2.5 7B β€” Evol-Instruct Code (LoRA)

Fine-tuned by Alok Kumar Dubey | GitHub | LinkedIn | HuggingFace

A LoRA adapter fine-tuned on top of Qwen2.5-7B-Instruct using the Evol-Instruct-Code-80k dataset β€” the same dataset used to train WizardCoder. The model handles complex coding tasks including algorithm design, debugging, time/space complexity optimization, and multi-language code generation.


πŸš€ Quick Start

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name     = "alok21in/qwen2.5-7b-evol-code",
    max_seq_length = 1024,
    load_in_4bit   = True,
)
FastLanguageModel.for_inference(model)

prompt = """Below is a coding instruction. Write a response that solves the task.

### Instruction:
Write a Python function to find all prime numbers up to n using the Sieve of Eratosthenes.

### Response:"""

inputs  = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=300, pad_token_id=tokenizer.eos_token_id)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response.split("### Response:")[-1].strip())

πŸ“Š Example Output

Input:

Write a function to check if two strings are anagrams. Optimize for time complexity.

Output:

def are_anagrams(s1: str, s2: str) -> bool:
    if len(s1) != len(s2):
        return False
    char_count = {}
    for char in s1:
        char_count[char] = char_count.get(char, 0) + 1
    for char in s2:
        if char not in char_count or char_count[char] == 0:
            return False
        char_count[char] -= 1
    return True
# Time complexity: O(n), Space complexity: O(k) where k = unique chars

πŸ‹οΈ Training Details

Parameter Value
Base Model Qwen/Qwen2.5-7B-Instruct
Dataset nickrosh/Evol-Instruct-Code-80k-v1
Training Samples 5,000 of 80,000
LoRA Rank (r) 8
LoRA Alpha 16
Target Modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Quantization 4-bit (QLoRA)
Max Seq Length 1024
Batch Size 1 (effective 8 with grad accumulation)
Learning Rate 2e-4
Steps 60
Optimizer adamw_8bit
Hardware Kaggle T4 GPU (15GB)
Framework Unsloth + TRL

πŸ“‹ About the Dataset

nickrosh/Evol-Instruct-Code-80k-v1 is the open-source implementation of the dataset behind WizardCoder, one of the top-performing code generation models. It contains 80k instruction-response pairs evolved from Code Alpaca through 3 rounds of complexity increases β€” covering algorithm design, debugging, optimization, and multi-language coding tasks.


πŸ“‰ Training Loss

Step Loss
1 ~0.724922
10 ~0.418077
20 ~0.488046
30 ~0.372955
40 ~0.337237
50 ~0.384731
60 ~0.349779

⚠️ Limitations

  • Trained on 5,000 of 80,000 available samples β€” more samples = better results
  • 60 steps is a quick fine-tune β€” not fully converged
  • Non-commercial license (inherited from dataset)
  • Best used as a research/portfolio demonstration

πŸ“œ License

CC-BY-NC-4.0 β€” Non-commercial use only (inherited from Evol-Instruct dataset which uses OpenAI outputs).


πŸ™ Acknowledgements

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for alok21in/qwen2.5-7b-evol-code

Base model

Qwen/Qwen2.5-7B
Adapter
(1769)
this model

Dataset used to train alok21in/qwen2.5-7b-evol-code

Paper for alok21in/qwen2.5-7b-evol-code