engineering_model / README.md
anmolthukral's picture
Add comprehensive model card with usage examples
1a1bad0 verified
|
Raw
History Blame Contribute Delete
3.08 kB
---
license: apache-2.0
base_model: Qwen/Qwen3.8-27B
tags:
- qwen
- finetune
- engineering
- code-generation
language:
- en
---
# engineering_model
Fine-tuned **Qwen3.8-27B** for engineering tasks: code generation, debugging, architecture design, and technical Q&A.
## Base model
[Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)
## Datasets used
- `open-vdb/glove-100-angular`
- `open-vdb/nytimes-16-angular`
- `open-vdb/nytimes-256-angular`
- `rsh-raj/angular-cli-commits`
- `rsh-raj/angular-commits`
- `lone17/angular-steering-artifacts`
## Usage
### With transformers (full model)
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "anmolthukral/engineering_model"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
prompt = "### User:\nWrite a Python function to detect cycles in a directed graph.\n### Assistant:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
repetition_penalty=1.1
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### With 4-bit quantization (recommended for 27B)
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True
)
model = AutoModelForCausalLM.from_pretrained(
"anmolthukral/engineering_model",
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
```
### Chat template (Qwen format)
```python
messages = [
{"role": "user", "content": "Explain the difference between mutex and semaphore"},
{"role": "assistant", "content": "..."},
{"role": "user", "content": "Show me a C++ example"}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# ... generate
```
## Hardware requirements
| Precision | VRAM (single GPU) | Notes |
|-----------|-------------------|-------|
| bfloat16 | ~54 GB | 2×A100 80GB or 4×A10G |
| 4-bit (NF4) | ~16 GB | 1×A10G / A100 40GB |
| 8-bit | ~28 GB | 1×A100 40GB |
## Limitations
- Trained on Angular/engineering data — may be biased toward frontend/web patterns
- 27B parameters requires significant compute for inference
- Not evaluated on safety benchmarks — use with caution in production
## Citation
```bibtex
@misc{engineering_model,
author = {Anmol Thukral},
title = {engineering_model: Qwen3.8-27B fine-tuned for engineering tasks},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/anmolthukral/engineering_model}}
}
```