Instructions to use hilarl/naturecode-dhivehi-270m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hilarl/naturecode-dhivehi-270m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hilarl/naturecode-dhivehi-270m") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hilarl/naturecode-dhivehi-270m", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hilarl/naturecode-dhivehi-270m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hilarl/naturecode-dhivehi-270m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hilarl/naturecode-dhivehi-270m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hilarl/naturecode-dhivehi-270m
- SGLang
How to use hilarl/naturecode-dhivehi-270m 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 "hilarl/naturecode-dhivehi-270m" \ --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": "hilarl/naturecode-dhivehi-270m", "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 "hilarl/naturecode-dhivehi-270m" \ --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": "hilarl/naturecode-dhivehi-270m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hilarl/naturecode-dhivehi-270m with Docker Model Runner:
docker model run hf.co/hilarl/naturecode-dhivehi-270m
Naturecode Dhivehi 270m
The first open-source Dhivehi language model optimized for natural conversations.
Model Description
Naturecode Dhivehi 270m is a fine-tuned language model specifically designed for Dhivehi, the official language of the Maldives. Built on Google's FunctionGemma-270m architecture, this model has been trained through a 6-phase curriculum learning approach on authentic Dhivehi text data.
Key Features
- Native Dhivehi Support: Trained on authentic Dhivehi text including formal and informal language
- Conversational: Optimized for natural dialogue in Dhivehi
- Lightweight: 270M parameters - efficient for deployment
- Curriculum Trained: Progressive training through 6 phases for robust language understanding
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("google/functiongemma-270m-it")
model = PeftModel.from_pretrained(base_model, "hilarl/naturecode-dhivehi-270m")
tokenizer = AutoTokenizer.from_pretrained("google/functiongemma-270m-it")
prompt = "<start_of_turn>user\nކިހިނެއް؟<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))
Training Details
- Base Model: google/functiongemma-270m-it
- Training Method: LoRA fine-tuning with curriculum learning (6 phases)
- Training Data: Curated Dhivehi corpus including dictionary entries, formal text, informal conversations, and SFT data
Intended Use
- Dhivehi language chatbots and assistants
- Dhivehi text generation
- Educational applications for Dhivehi language learning
- Research on low-resource language models
Limitations
- Primarily trained for conversational use; may not excel at technical domains
- Performance may vary with highly specialized vocabulary
- Should not be used for generating harmful or misleading content
License
Apache 2.0
Citation
@misc{naturecode-dhivehi-270m,
author = {Naturecode},
title = {Naturecode Dhivehi 270m},
year = {2025},
publisher = {HuggingFace},
}
Model tree for hilarl/naturecode-dhivehi-270m
Base model
google/functiongemma-270m-it