Instructions to use Dnfs/Mangga-1-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Dnfs/Mangga-1-4B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use Dnfs/Mangga-1-4B 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 Dnfs/Mangga-1-4B 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 Dnfs/Mangga-1-4B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Dnfs/Mangga-1-4B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Dnfs/Mangga-1-4B", max_seq_length=2048, )
Model Gemma-3-4B Fine-tuned - Mango City Edition
This model is fine-tuned from unsloth/gemma-3-1b-it-unsloth-bnb-4bit-unsloth-bnb-4bit using the LoRA (Low-Rank Adaptation) method with a specific dataset focused on local knowledge (such as "Kota Mangga" - Indramayu, the Mango City).
This model was trained using Unsloth for significant memory and speed efficiency.
Repository Structure
This repository contains the model in two formats for flexibility:
βββ config.json
βββ model.safetensors
βββ tokenizer.json
βββ tokenizer_config.json
βββ special_tokens_map.json
βββ generation_config.json
βββ adapter/ # adapter LoRA
βββ adapter_config.json
βββ adapter_model.safetensors
βββ ...
How to Use
1. Using the Merged Model
This is the easiest way to use the model. You will be loading a ready-to-use merged model.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "Dnfs/Mangga-1-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Contoh penggunaan
inputs = tokenizer("Siapakah bupati Indramayu saat ini?", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
2. Using the LoRA Adapter
If you want to apply the adapter to the base model manually.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model_id = "unsloth/gemma-3-1b-it-unsloth-bnb-4bit"
adapter_id = "Dnfs/Mangga-1-4B"
# Load the base model
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# Load the tokenizer from this repo (as there might be new tokens)
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
# Apply the adapter
model = PeftModel.from_pretrained(
base_model,
adapter_id,
subfolder="adapter" # Don't forget the subfolder
)
# Example usage
inputs = tokenizer("Jelaskan tentang julukan Indramayu sebagai Kota Mangga.", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Model Details
Model Hierarchy:
- Original Model:
google/gemma-3-4b-it(Google Gemma-3-4B Instruct) - Unsloth Base Model:
unsloth/gemma-3-1b-it-unsloth-bnb-4bit(Optimized version of the Google model) - Training Model:
unsloth/gemma-3-1b-it-unsloth-bnb-4bit-unsloth-bnb-4bit(4-bit quantized version for fine-tuning) - Final Model:
Dnfs/Mangga-1-4B(The fine-tuned model)
Specifications:
- Method: LoRA (Low-Rank Adaptation) via Unsloth
- Language: id (Indonesia)
- Upload Precision: 16-bit
Lisensi
Developed by: Denny Firmansyah Suwardi
Apache 2.0
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support