Views
No views yet
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-use1from unsloth import FastLanguageModel
2from peft import PeftModel
3from transformers import AutoTokenizer
4import torch
5
6BASE_MODEL = "Qwen/Qwen3-8B-Base"
7CPT_ADAPTER = "themohal/saraiki-qwen3-8b-cpt"
8SFT_ADAPTER = "themohal/saraiki-qwen-8b-sft"
9
10tokenizer = AutoTokenizer.from_pretrained(SFT_ADAPTER)
11
12model, _ = FastLanguageModel.from_pretrained(
13 model_name=BASE_MODEL, load_in_4bit=True, dtype=None,
14)
15model.resize_token_embeddings(len(tokenizer))
16
17# Merge chain: base -> CPT -> SFT
18model = PeftModel.from_pretrained(model, CPT_ADAPTER).merge_and_unload()
19model = PeftModel.from_pretrained(model, SFT_ADAPTER)
20
21messages = [{"role": "user", "content": "میڈا ناں کیا اے؟"}]
22
23prompt = tokenizer.apply_chat_template(
24 messages,
25 tokenize=False,
26 add_generation_prompt=True,
27 enable_thinking=False, # see "Thinking mode" below
28)
29
30inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
31outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.9)
32print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))<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 a Gemini-based generate → validate → repair → dedupe pipeline.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.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.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) |