Instructions to use novanandriyono/javanese-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use novanandriyono/javanese-qlora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-3-4b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "novanandriyono/javanese-qlora") - Transformers
How to use novanandriyono/javanese-qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="novanandriyono/javanese-qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("novanandriyono/javanese-qlora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use novanandriyono/javanese-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "novanandriyono/javanese-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "novanandriyono/javanese-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/novanandriyono/javanese-qlora
- SGLang
How to use novanandriyono/javanese-qlora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "novanandriyono/javanese-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "novanandriyono/javanese-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "novanandriyono/javanese-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "novanandriyono/javanese-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use novanandriyono/javanese-qlora with Docker Model Runner:
docker model run hf.co/novanandriyono/javanese-qlora
javanese-qlora
A QLoRA adapter that fine-tunes Gemma 3 4B IT for Javanese (Basa Jawa) conversation and text generation.
- Demo: novanandriyono/javanese (Hugging Face Space, ZeroGPU)
- Developed by: Novan Andriyono (novanandriyono)
- Model type: LoRA adapter (PEFT), not a standalone model
- Language: Javanese (
jv) - Base model: unsloth/gemma-3-4b-it-unsloth-bnb-4bit
- Fine-tuning method: QLoRA (4-bit NF4 base, trained with Unsloth)
- Adapter size: ~600 MB (
adapter_model.safetensors) - License: Gemma Terms of Use. This adapter is a derivative of Gemma and is subject to those terms.
Status: experimental and still in development. Output quality varies, especially for speech levels (ngoko, krama) and rare vocabulary.
Intended use
- Chat and instruction following in Javanese
- Experiments on low-resource language adaptation
- Research and hobby projects
Out-of-scope use
- Anything that needs factual reliability (medical, legal, financial advice)
- Authoritative translation or official documents
- Any use prohibited by the Gemma Prohibited Use Policy
How to use
The adapter was trained on the 4-bit base, but it can be applied to the bf16 base (unsloth/gemma-3-4b-it) and merged for inference. This is what the demo Space does.
Option 1: bf16 base + merge (needs ~10 GB VRAM)
import torch
from transformers import AutoTokenizer, Gemma3ForConditionalGeneration
from peft import PeftModel
BASE = "unsloth/gemma-3-4b-it"
LORA = "novanandriyono/javanese-qlora"
tok = AutoTokenizer.from_pretrained(LORA)
model = Gemma3ForConditionalGeneration.from_pretrained(
BASE, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(model, LORA)
model = model.merge_and_unload()
model.eval()
messages = [{"role": "user", "content": "Sugeng enjang! Critakna babagan Gunung Bromo."}]
inputs = tok.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=512, do_sample=True,
temperature=0.7, top_p=0.9)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Option 2: 4-bit base with bitsandbytes (lower VRAM)
import torch
from transformers import AutoTokenizer, Gemma3ForConditionalGeneration, BitsAndBytesConfig
from peft import PeftModel
BASE = "unsloth/gemma-3-4b-it-unsloth-bnb-4bit"
LORA = "novanandriyono/javanese-qlora"
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
tok = AutoTokenizer.from_pretrained(LORA)
model = Gemma3ForConditionalGeneration.from_pretrained(
BASE, quantization_config=bnb, device_map="auto"
)
model = PeftModel.from_pretrained(model, LORA)
model.eval()
If you get a key mismatch error when loading, try AutoModelForCausalLM instead of Gemma3ForConditionalGeneration.
Training details
| Base model | unsloth/gemma-3-4b-it-unsloth-bnb-4bit |
| Method | QLoRA (PEFT 0.18.1, Unsloth) |
| Train as | Language model (text only) |
| Training data | TODO: describe the dataset (source, size, format) |
| LoRA rank / alpha | TODO |
| Epochs / steps | TODO |
| Learning rate | TODO |
| Max sequence length | TODO |
| Hardware | TODO |
Limitations and bias
- The model can produce incorrect, inconsistent, or made-up content.
- Javanese has several speech levels (ngoko, madya, krama), and the model may mix them or pick the wrong register.
- Regional dialects and rare words may be poorly covered.
- It inherits the limitations and biases of the base model (Gemma 3) and of the training data.
- Vision input is not trained or evaluated in this adapter. Use text only.
Framework versions
- PEFT 0.18.1
- Transformers >= 4.50
Contact
Open a discussion on this repo's Community tab.
- Downloads last month
- 21
Model tree for novanandriyono/javanese-qlora
Base model
google/gemma-3-4b-pt