Instructions to use Threedotz/llama3.1-8b-qlora-alpaca-indonesian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Threedotz/llama3.1-8b-qlora-alpaca-indonesian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Threedotz/llama3.1-8b-qlora-alpaca-indonesian") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Threedotz/llama3.1-8b-qlora-alpaca-indonesian") model = AutoModelForCausalLM.from_pretrained("Threedotz/llama3.1-8b-qlora-alpaca-indonesian") 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 Threedotz/llama3.1-8b-qlora-alpaca-indonesian with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Threedotz/llama3.1-8b-qlora-alpaca-indonesian" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Threedotz/llama3.1-8b-qlora-alpaca-indonesian", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Threedotz/llama3.1-8b-qlora-alpaca-indonesian
- SGLang
How to use Threedotz/llama3.1-8b-qlora-alpaca-indonesian 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 "Threedotz/llama3.1-8b-qlora-alpaca-indonesian" \ --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": "Threedotz/llama3.1-8b-qlora-alpaca-indonesian", "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 "Threedotz/llama3.1-8b-qlora-alpaca-indonesian" \ --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": "Threedotz/llama3.1-8b-qlora-alpaca-indonesian", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Threedotz/llama3.1-8b-qlora-alpaca-indonesian with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Threedotz/llama3.1-8b-qlora-alpaca-indonesian to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Threedotz/llama3.1-8b-qlora-alpaca-indonesian to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Threedotz/llama3.1-8b-qlora-alpaca-indonesian to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Threedotz/llama3.1-8b-qlora-alpaca-indonesian", max_seq_length=2048, ) - Docker Model Runner
How to use Threedotz/llama3.1-8b-qlora-alpaca-indonesian with Docker Model Runner:
docker model run hf.co/Threedotz/llama3.1-8b-qlora-alpaca-indonesian
Model Card for threedotz/llama3.1-8b-qlora-alpaca-indonesian
A fine-tuned Llama 3.1 8B model trained using QLoRA on Indonesian Alpaca instruction dataset.
Model Details
Model Description
This is a fine-tuned version of unsloth/Llama-3.1-8B using QLoRA (Quantized Low-Rank Adaptation) via Unsloth. The model is trained on Ichsan2895/alpaca-gpt4-indonesian dataset containing 49,969 Indonesian instruction-response pairs.
The model uses Llama 3.1 chat template with the system prompt: "Kamu adalah asisten AI yang membantu menjawab pertanyaan pengguna berdasarkan konteks yang diberikan."
- Developed by: Threedotz
- Model type: Language Model (Causal LM)
- Language(s) (NLP): Indonesian (id)
- License: llama3.1 license
- Finetuned from model: unsloth/Llama-3.1-8B
Model Sources
- Repository: https://huggingface.co/threedotz/llama3.1-8b-qlora-alpaca-indonesian
- Base Model: https://huggingface.co/unsloth/Llama-3.1-8B
- Training Dataset: https://huggingface.co/datasets/Ichsan2895/alpaca-gpt4-indonesian
Uses
Direct Use
Indonesian language tasks:
- Question answering in Bahasa Indonesia
- Instruction following
- Text generation in Indonesian
Out-of-Scope Use
- Non-Indonesian language tasks
- Medical, legal, or financial advice without human oversight
How to Get Started with the Model
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
import torch
# Load model
model_name = "threedotz/llama3.1-8b-qlora-alpaca-indonesian"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
# Prompt
prompt = "Apa itu machine learning?"
# Tokenize & generate
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
text_streamer = TextStreamer(tokenizer, skip_prompt=True)
_ = model.generate(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"],
max_new_tokens=256, streamer=text_streamer)
Training Details
Training Data
- Dataset: Ichsan2895/alpaca-gpt4-indonesian
- Size: 49,969 instruction-response pairs
- Language: Indonesian (Bahasa Indonesia)
- Format: Alpaca instruction format (input → output)
- License: CC-BY-SA-4.0
Training Procedure
Preprocessing
Dataset formatted using Llama 3.1 chat template with system prompt.
Training Hyperparameters
| Hyperparameter | Value |
|---|---|
| Training regime | 4-bit QLoRA (bf16/fp16) |
| Max steps | 800 |
| Per device batch size | 1 |
| Gradient accumulation steps | 4 |
| Total batch size | 4 |
| Learning rate | 2e-4 |
| LR scheduler | linear |
| Warmup steps | 5 |
| Max sequence length | 512 |
| Optimizer | paged_adamw_8bit |
| Gradient checkpointing | unsloth |
QLoRA Configuration
| Parameter | Value |
|---|---|
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| LoRA dropout | 0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Load in 4-bit | True |
Model Statistics
| Metric | Value |
|---|---|
| Total parameters | 8,072,204,288 |
| Trainable parameters | 41,943,040 |
| Trainable % | 0.52% |
Technical Specifications
Model Architecture
- Architecture: Llama 3.1 (Decoder-only Transformer)
- Parameters: 8 billion
- Quantization: 4-bit (QLoRA)
- Max sequence length: 2048
Compute Infrastructure
- GPU: Tesla T4 (Kaggle)
- Training time: ~1h 17min 11s
- Framework: Unsloth + TRL + Transformers
Citation
BibTeX:
@misc{threedotz2024llama31indonesian,
author = {Threedotz},
title = {Llama 3.1 8B QLoRA Fine-tuned on Alpaca Indonesian},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/threedotz/llama3.1-8b-qlora-alpaca-indonesian}
}
Model Card Contact
For questions, please contact Threedotz on HuggingFace.
- Downloads last month
- 12