Text Generation
Transformers
Safetensors
Indonesian
qwen3
bahasa-indonesia
lora
lora-merged
sft
multitask
sentiment-analysis
summarization
chatml
conversational
text-generation-inference
Instructions to use Adicandra/Qwen3-4B-Multitask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Adicandra/Qwen3-4B-Multitask with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Adicandra/Qwen3-4B-Multitask") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Adicandra/Qwen3-4B-Multitask") model = AutoModelForCausalLM.from_pretrained("Adicandra/Qwen3-4B-Multitask") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Adicandra/Qwen3-4B-Multitask with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Adicandra/Qwen3-4B-Multitask" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Adicandra/Qwen3-4B-Multitask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Adicandra/Qwen3-4B-Multitask
- SGLang
How to use Adicandra/Qwen3-4B-Multitask 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 "Adicandra/Qwen3-4B-Multitask" \ --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": "Adicandra/Qwen3-4B-Multitask", "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 "Adicandra/Qwen3-4B-Multitask" \ --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": "Adicandra/Qwen3-4B-Multitask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Adicandra/Qwen3-4B-Multitask with Docker Model Runner:
docker model run hf.co/Adicandra/Qwen3-4B-Multitask
| base_model: aitf-kpm-ugm/Qwen3-4B-CPT-Base | |
| library_name: transformers | |
| language: | |
| - id | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| tags: | |
| - qwen3 | |
| - bahasa-indonesia | |
| - lora | |
| - lora-merged | |
| - sft | |
| - multitask | |
| - sentiment-analysis | |
| - summarization | |
| - chatml | |
| datasets: | |
| - custom | |
| # Qwen3-4B SFT-CPT — Multitask Bahasa Indonesia (LoRA merged) | |
| Model ini merupakan hasil fine-tuning (LoRA, sudah di-**merge** ke base weights) dari | |
| [`aitf-kpm-ugm/Qwen3-4B-CPT-Base`](https://huggingface.co/aitf-kpm-ugm/Qwen3-4B-CPT-Base) untuk berbagai tugas NLP **Bahasa Indonesia** | |
| menggunakan format ChatML. | |
| --- | |
| ## Deskripsi Singkat | |
| | Atribut | Nilai | | |
| |---|---| | |
| | Base model | `aitf-kpm-ugm/Qwen3-4B-CPT-Base` | | |
| | Metode fine-tune | LoRA (r=64, alpha=128) | | |
| | Status adapter | **Merged** ke base weights | | |
| | Bahasa output | Bahasa Indonesia 🇮🇩 | | |
| | Format chat | ChatML (Qwen3-instruct) | | |
| | EOS token | `<\|im_end\|>` | | |
| | Precision | bfloat16 | | |
| | Max seq length | 2048 | | |
| | Training epochs | 3 | | |
| | Train samples | ~93,579 | | |
| | Best val loss | 0.343 | | |
| --- | |
| ## Cara Pakai (Inference) | |
| ```python | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| REPO = "Adicandra/Qwen3-4B-Multitask" | |
| tokenizer = AutoTokenizer.from_pretrained(REPO) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| REPO, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto", | |
| ) | |
| model.eval() | |
| messages = [ | |
| {"role": "system", "content": "Kamu adalah asisten AI yang membantu."}, | |
| {"role": "user", "content": "Ringkaskan teks berikut: ..."}, | |
| ] | |
| text = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True, | |
| ) | |
| inputs = tokenizer(text, return_tensors="pt").to(model.device) | |
| input_len = inputs.input_ids.shape[1] | |
| im_end_id = tokenizer.convert_tokens_to_ids("<|im_end|>") | |
| with torch.no_grad(): | |
| out = model.generate( | |
| **inputs, | |
| max_new_tokens=512, | |
| do_sample=False, | |
| use_cache=True, | |
| eos_token_id=im_end_id, | |
| pad_token_id=tokenizer.pad_token_id, | |
| ) | |
| response = tokenizer.decode(out[0, input_len:], skip_special_tokens=True) | |
| print(response) | |
| ``` | |
| --- | |
| ## Training Details | |
| - **Framework**: Unsloth + TRL SFTTrainer | |
| - **LoRA config**: r=64, alpha=128, target modules = q/k/v/o/gate/up/down_proj | |
| - **Optimizer**: AdamW 8-bit | |
| - **LR scheduler**: Cosine with warmup ratio 0.03 | |
| - **Batch size**: 6 × 8 gradient accumulation = effective 48 | |
| - **train_on_responses_only**: Ya (hanya loss pada respons assistant) | |
| --- | |
| ## Lisensi | |
| Mengikuti lisensi base model: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). | |