Downloads · 30 days
0
themohal/saraiki-qwen-8b-tool-use
saraiki-qwen-8b-tool-use is a text generation model from themohal. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A LoRA adapter that turns Qwen3-8B-Base into an instruction-following conversational assistant for Jataki Saraiki (سرائیکی).
Downloads · 30 days
0
Access
Public
Updated Sep 19, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md7.4 KB · 83%
From the Hugging Face model README
A LoRA adapter that turns Qwen3-8B-Base into an instruction-following conversational assistant for Jataki Saraiki (سرائیکی).
This is Stage 2 of a three-stage pipeline:
Qwen/Qwen3-8B-Base
│
├─▶ Stage 1: Continued pretraining (CPT) on Saraiki text
│ themohal/saraiki-qwen3-8b-cpt
│
├─▶ Stage 2: Instruction/assistant SFT ◀── this model
│ themohal/saraiki-qwen-8b-sft
│
└─▶ Stage 3: Tool-use / function-calling SFT
themohal/saraiki-qwen-8b-tool-use
Stage 2 merges the finished Stage 1 CPT adapter into the base weights, then trains a fresh LoRA adapter on top for instruction-following — so this model is Saraiki-fluent (from Stage 1's continued pretraining on Saraiki text) and able to hold a conversation and follow instructions, rather than just completing Saraiki text.
Given a Saraiki instruction or question, the model responds conversationally in Saraiki — general assistant-style behavior (answering questions, explaining things, following instructions) grounded in the Saraiki continued-pretraining from Stage 1. It does not call tools/functions — that capability is added on top in Stage 3.
from unsloth import FastLanguageModel
from peft import PeftModel
from transformers import AutoTokenizer
import torch
BASE_MODEL = "Qwen/Qwen3-8B-Base"
CPT_ADAPTER = "themohal/saraiki-qwen3-8b-cpt"
SFT_ADAPTER = "themohal/saraiki-qwen-8b-sft"
tokenizer = AutoTokenizer.from_pretrained(SFT_ADAPTER)
model, _ = FastLanguageModel.from_pretrained(
model_name=BASE_MODEL, load_in_4bit=True, dtype=None,
)
model.resize_token_embeddings(len(tokenizer))
# Merge chain: base -> CPT -> SFT
model = PeftModel.from_pretrained(model, CPT_ADAPTER).merge_and_unload()
model = PeftModel.from_pretrained(model, SFT_ADAPTER)
messages = [{"role": "user", "content": "میڈا ناں کیا اے؟"}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False, # see "Thinking mode" below
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.9)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Qwen3 defaults to thinking mode on (<think>...</think> before every response). This model was trained with enable_thinking=False — themohal/saraiki-assistant-sft is plain instruction/response data with no reasoning traces, so training with thinking mode on would just teach the model to emit empty <think>\n\n</think> blocks as noise before every answer. Set enable_thinking=False at inference time to match training. Stage 3 was trained matching this same setting for consistency across the pipeline.
themohal/saraiki-assistant-sft — Saraiki question/answer conversation pairs, generated and validated through → validate → repair → dedupe pipeline.
This dataset grows daily (roughly once per morning), so this model is retrained continually rather than as a single fixed run — see Continual training below.
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj; base model weights frozen throughout.assistant_only_loss=True (TRL) — loss computed only on assistant-generated spans, not on user turns.SFTTrainer, dataset auto-detected and converted to the messages conversational format.Because the training dataset grows daily, this model does not use naive resume_from_checkpoint on every run — that assumes a static dataset, which a growing corpus violates (the train/validation split membership and packed-sequence composition change as rows are added). Instead:
data_manifest.json alongside each pushed checkpoint.resume_from_checkpoint (same optimizer state, same LR schedule position) — this is what happens on same-day reruns.This means the adapter is best understood as a continually-improving artifact rather than a single frozen release — check the commit history / data_manifest.json in the most recent checkpoint folder for what it was actually trained on.
| Repo | Purpose |
|---|---|
themohal/saraiki-qwen3-8b-cpt | Stage 1 — continued pretraining LoRA |
themohal/saraiki-qwen-8b-tool-use | Stage 3 — tool-use/function-calling SFT LoRA, built on top of this model |
themohal/saraiki-llm-dataset | Stage 1 training corpus (grows daily) |
themohal/saraiki-assistant-sft | Stage 2 training data — this model (grows daily) |
themohal/saraiki-tool-use-sft | Stage 3 training data (grows daily) |
Muhammad Farjad Ali Raza
Apache 2.0, inherited from the Qwen3-8B-Base license. Training data is synthetically generated; see the dataset card for generation details.