Text Generation
PEFT
Safetensors
English
lora
qwen3_5
ornith
ornith-1.5-9b
qlora
sft
iec-61131-3
structured-text
plc
industrial-automation
conversational
Instructions to use adarrshDev/ornith-1.5-9b-sft-r16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use adarrshDev/ornith-1.5-9b-sft-r16 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("ornith-ai/Ornith-1.5-9B") model = PeftModel.from_pretrained(base_model, "adarrshDev/ornith-1.5-9b-sft-r16") - Notebooks
- Google Colab
- Kaggle
Ornith-1.5-9B β IEC 61131-3 Structured Text SFT (LoRA r=16)
A QLoRA fine-tuned LoRA adapter for ornith-ai/Ornith-1.5-9B (Qwen3.5 architecture) specialised in generating, refactoring, and reasoning about IEC 61131-3 Structured Text (ST) industrial control logic (OSCAT library standards, Siemens SCL dialects, and Plant-01 safety interlocks).
π¬ Model Details
| Property | Value |
|---|---|
| Base Model | ornith-ai/Ornith-1.5-9B |
| Base Architecture | Qwen3.5 Dense (qwen3_5), Multimodal Reasoner |
| PEFT Method | QLoRA (4-bit NF4 quantized base + Float32/BFloat16 LoRA adapters) |
| LoRA Rank ($r$) | 16 |
| LoRA Alpha ($\alpha$) | 32 ($\alpha/r = 2.0$) |
| LoRA Dropout | 0.0 |
| Target Modules | Attention & MLP projections (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj) |
| Trainable Parameters | 29,097,984 / 9,438,911,728 (0.31%) |
| Context Length | 2,048 tokens (Base supports up to 262K) |
| Training Hardware | NVIDIA Tesla T4 (16 GB VRAM) on Google Cloud |
| Training Duration | 446.1 seconds |
| Framework | Unsloth 2026.8.22 + TRL + HuggingFace PEFT |
| Base License | MIT |
π Training Convergence & Loss Curve
Trained for 3 full epochs (9 optimization steps with effective batch size 8):
| Step | Epoch | Training Loss | Learning Rate | Grad Norm |
|---|---|---|---|---|
| 1/9 | 0.4 | 2.614 | 0.00e+00 (Warmup) | 3.655 |
| 2/9 | 0.8 | 2.683 | 2.00e-04 | 4.080 |
| 3/9 | 1.0 | 2.691 | 1.92e-04 | 2.888 |
| 4/9 | 1.4 | 1.896 | 1.71e-04 | 1.636 |
| 5/9 | 1.8 | 1.646 | 1.38e-04 | 1.461 |
| 6/9 | 2.0 | 1.312 | 1.00e-04 | 1.519 |
| 7/9 | 2.4 | 1.228 | 6.17e-05 | 1.365 |
| 8/9 | 2.8 | 1.082 | 2.93e-05 | 1.558 |
| 9/9 | 3.0 | 1.105 | 7.61e-06 | 1.756 |
- Initial Loss:
2.614 - Final Converged Loss:
1.105 - Mean Loss across Run:
1.806
π¦ Training Data Specification
- Domain: IEC 61131-3 Structured Text (ST) / Siemens SCL for PLC and DCS industrial automation.
- Corpus Structure: OSCAT basic automation library blocks, Plant-01 twin interlocks, and safety refusal prompts.
- Format: ChatML / OpenAI JSONL multi-turn format (
messagesschema).
π» How to Load and Use with Transformers & PEFT
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "ornith-ai/Ornith-1.5-9B"
adapter_id = "adarrshDev/ornith-1.5-9b-sft-r16"
# 1. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# 2. Attach the Fine-Tuned Ornith LoRA Adapter
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
# 3. Generate Structured Text logic
messages = [
{"role": "user", "content": "Write an IEC 61131-3 Structured Text FUNCTION_BLOCK for a debounced digital input with configurable ON/OFF delay timers."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
βοΈ License & Governance
This adapter is distributed under the MIT License, consistent with the ornith-ai/Ornith-1.5-9B upstream base model.
- Downloads last month
- 27
Model tree for adarrshDev/ornith-1.5-9b-sft-r16
Base model
ornith-ai/Ornith-1.5-9B