CoolFace
Modelpublic

adarrshDev/ornith-1.5-9b-sft-r16

sourceHugging Facemitupdated 24d agoView on Hugging Face
0likes43downloads
Model Card

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

PropertyValue
Base Model`ornith-ai/Ornith-1.5-9B`
Base ArchitectureQwen3.5 Dense (qwen3_5), Multimodal Reasoner
PEFT MethodQLoRA (4-bit NF4 quantized base + Float32/BFloat16 LoRA adapters)
LoRA Rank ($r$)16
LoRA Alpha ($\alpha$)32 ($\alpha/r = 2.0$)
LoRA Dropout0.0
Target ModulesAttention & MLP projections (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj)
Trainable Parameters29,097,984 / 9,438,911,728 (0.31%)
Context Length2,048 tokens (Base supports up to 262K)
Training HardwareNVIDIA Tesla T4 (16 GB VRAM) on Google Cloud
Training Duration446.1 seconds
FrameworkUnsloth 2026.8.22 + TRL + HuggingFace PEFT
Base LicenseMIT

๐Ÿ“Š Training Convergence & Loss Curve

Trained for 3 full epochs (9 optimization steps with effective batch size 8):

StepEpochTraining LossLearning RateGrad Norm
1/90.42.6140.00e+00 (Warmup)3.655
2/90.82.6832.00e-044.080
3/91.02.6911.92e-042.888
4/91.41.8961.71e-041.636
5/91.81.6461.38e-041.461
6/92.01.3121.00e-041.519
7/92.41.2286.17e-051.365
8/92.81.0822.93e-051.558
9/93.01.1057.61e-061.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 (messages schema).

๐Ÿ’ป How to Load and Use with Transformers & PEFT

python
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.