Views
No views yet
[CARI: <query>], then answers from an injected [HASIL PENCARIAN] blockIMPORTANT — avoid stuck downloads: the HF Xet backend is known to stall at theReconstructing (incomplete total...)stage (xet-core#850). Disable Xet before any imports:
1import os
2os.environ["HF_HUB_DISABLE_XET"] = "1" # MUST be the very first cell/line1pip uninstall -y hf-xet
2pip install unsloth1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 "TheCoderScientist/GarudaCoder-7B-Coder-ID-lora",
5 max_seq_length=4096, load_in_4bit=True,
6)
7FastLanguageModel.for_inference(model)
8
9pesan = [
10 {"role": "system", "content": "Kamu adalah GarudaCoder, asisten coding berbahasa Indonesia yang teliti, menjelaskan alasan sebelum menulis kode, dan tidak pernah mengarang fakta."},
11 {"role": "user", "content": "Kenapa [[0]*3]*3 di Python bikin semua baris ikut berubah?"},
12]
13inputs = tokenizer.apply_chat_template(pesan, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
14out = model.generate(input_ids=inputs, max_new_tokens=1024, temperature=0.3, do_sample=True)
15print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3from peft import PeftModel
4
5bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
6 bnb_4bit_compute_dtype=torch.float16)
7base = AutoModelForCausalLM.from_pretrained(
8 "unsloth/Qwen2.5-Coder-7B-Instruct", quantization_config=bnb, device_map="auto")
9model = PeftModel.from_pretrained(base, "TheCoderScientist/GarudaCoder-7B-Coder-ID-lora")
10tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen2.5-Coder-7B-Instruct")temperature=0.3, do_sample=True, max_new_tokens=1024–1536.model.safetensors in this repo is small; the Qwen2.5-Coder-7B base model is downloaded automatically on load.[CARI: ...] behavior: when the model needs up-to-date information it writes that tag, then answers from a [HASIL PENCARIAN] ... block you inject into the next turn. Without a search harness, just ignore the tag.| Symptom | Cause | Fix |
|---|---|---|
Download stuck at Reconstructing (incomplete total...) | hf_xet stall bug | HF_HUB_DISABLE_XET=1 before imports, or pip uninstall hf-xet |
CUDA out of memory on T4 | loaded without 4-bit | make sure load_in_4bit=True |
| English / shallow answers | system prompt not used | use the system prompt above verbatim |
KeyError / adapter won't attach in PEFT | wrong base model | use unsloth/Qwen2.5-Coder-7B-Instruct (or Qwen/Qwen2.5-Coder-7B-Instruct) |
train_on_responses_only + DPO (chosen=reasoning/honest, rejected=code-dump/hallucination)