TypeScript SLM 7B

Standard 7B TypeScript model for TypeScript code generation, optimized for React, Next.js, Angular, and Node.js.

Model Details

  • Base Model: Qwen/Qwen2.5-Coder-7B-Instruct
  • Model Size: 7B parameters
  • Training Method: LoRA (Low-Rank Adaptation)
  • Context Length: 2048 tokens
  • LoRA Rank: 64
  • Training Dataset: 5,000 high-quality TypeScript samples

Training Configuration

  • Batch Size: 2
  • Gradient Accumulation: 16
  • Effective Batch Size: 32
  • Learning Rate: 0.0001
  • Epochs: 3
  • Hardware: Google Colab A100 40GB

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model = "Qwen/Qwen2.5-Coder-7B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    device_map="auto",
    torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained(base_model)

# Load LoRA adapter
model = PeftModel.from_pretrained(model, "sylvester-francis/typescript-slm-7b")

# Generate code
prompt = "Write a React component with TypeScript:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0]))

Repository

https://github.com/sylvester-francis/slm-typescript-model

Downloads last month
11
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for sylvester-francis/typescript-slm-7b

Base model

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