Downloads · 30 days
21
51% of all-time downloads
sylvester-francis/typescript-slm-7b-reasoning
typescript-slm-7b-reasoning is a text generation model from sylvester-francis. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
7B TypeScript model with reasoning capabilities for TypeScript code generation, optimized for React, Next.js, Angular, and Node.js.
Downloads · 30 days
21
51% of all-time downloads
All-time downloads
41
Public
Repo size
1.9 GB
Likes
1
Public
Click a slice to open those files.
.pt1.3 GB · 50%
From the Hugging Face model README
7B TypeScript model with reasoning capabilities for TypeScript code generation, optimized for React, Next.js, Angular, and Node.js.
This variant includes chain-of-thought reasoning for better code understanding and generation.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
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-reasoning")
# 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]))