Instructions to use shisha-07/Llama-3-Indian-Gender-Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use shisha-07/Llama-3-Indian-Gender-Classifier with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="shisha-07/Llama-3-Indian-Gender-Classifier", filename="GGUF/llama-3-8b.Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shisha-07/Llama-3-Indian-Gender-Classifier with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M # Run inference directly in the terminal: llama-cli -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M # Run inference directly in the terminal: llama-cli -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
Use Docker
docker model run hf.co/shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use shisha-07/Llama-3-Indian-Gender-Classifier with Ollama:
ollama run hf.co/shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
- Unsloth Studio
How to use shisha-07/Llama-3-Indian-Gender-Classifier 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 shisha-07/Llama-3-Indian-Gender-Classifier 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 shisha-07/Llama-3-Indian-Gender-Classifier to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shisha-07/Llama-3-Indian-Gender-Classifier to start chatting
- Atomic Chat new
- Docker Model Runner
How to use shisha-07/Llama-3-Indian-Gender-Classifier with Docker Model Runner:
docker model run hf.co/shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
- Lemonade
How to use shisha-07/Llama-3-Indian-Gender-Classifier with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shisha-07/Llama-3-Indian-Gender-Classifier:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3-Indian-Gender-Classifier-Q4_K_M
List all available models
lemonade list
๐ฎ๐ณ Llama-3 Indian Name Gender Classifier
๐ Model Description
This is a fine-tuned version of the Llama-3-8B model, specifically optimized to classify the gender of Indian Names into three categories: Male, Female, and Neutral.
The model was trained using Unsloth for efficient 4-bit fine-tuning and has been exported in multiple formats to support both production (Python/GPU) and local (CPU/Laptop) environments.
๐ ๏ธ Source Code
The training code and notebooks are available on GitHub:
Key Features
- High Precision for Females: The model achieves 100% precision on female names in validation tests.
- Regional Awareness: Trained specifically on Indian linguistic patterns.
- Multi-Format: Available as LoRA adapters, Merged 16-bit weights, and GGUF.
๐ Repository Structure
This repository is organized into three specific folders to keep files clean. Please select the folder that matches your use case:
| Folder | Format | Use Case |
|---|---|---|
/Merged |
SafeTensors (16-bit) | Best for Python, vLLM, and Production APIs. This is the standalone model with weights baked in. |
/GGUF |
GGUF (q4_k_m) | Best for Ollama, LM Studio, and Local CPU Inference. |
/LoRA |
LoRA Adapters | Best for Research, Unsloth, and PEFT loading. Contains only the fine-tuned difference. |
๐ Evaluation & Performance
The model was evaluated on a held-out test set of 59 diverse Indian names, including difficult unisex/neutral examples.
Summary Metrics
| Metric | Score | Interpretation |
|---|---|---|
| Accuracy | 86.44% | Overall correctness across all categories. |
| F1-Score | 0.8355 | Weighted score balancing precision and recall. |
Detailed Breakdown
| Category | Precision | Recall | F1-Score | Analysis |
|---|---|---|---|---|
| Male | 0.76 | 1.00 | 0.87 | Catches all males, but sometimes over-predicts male for neutral names. |
| Female | 1.00 | 0.96 | 0.98 | Extremely reliable. If it says "Female", it is almost certainly correct. |
| Neutral | 1.00 | 0.22 | 0.36 | Struggles with ambiguity; often defaults to "Male". |
โ ๏ธ Known Limitations & Bias
- Male Defaulting: The model has a strong bias to classify ambiguous or neutral names as Male.
- Failed Examples:
Kiran,Sonu,Suman,Gurpreet(Predicted: Male).
- Failed Examples:
- Specific Mismatches: The name
Simranwas incorrectly predicted asMalein our validation set. - Scope: This model is strictly for Indian names and may not perform accurately on Western or East Asian names.
๐ How to Use
1. Python (Transformers) - Recommended
Use this method if you are running a script or a web server. Note: You must specify subfolder="Merged".
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# 1. Load from the 'Merged' folder
model_id = "shisha-07/Llama-3-Indian-Gender-Classifier"
tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="Merged")
model = AutoModelForCausalLM.from_pretrained(
model_id,
subfolder="Merged",
device_map="auto",
torch_dtype=torch.float16
)
# 2. Define the Prompt (Alpaca Format)
prompt_template = """### Instruction:
Identify the gender of the given Indian name.
### Input:
{}
### Response:
"""
# 3. Run Inference
name = "Ananya"
inputs = tokenizer(prompt_template.format(name), return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_new_tokens=10)
print(tokenizer.decode(output[0], skip_special_tokens=True))
# Output: Female
2. GGUF (Ollama / Local) -
Download the .gguf file from the GGUF Folder.
- CLI Command:
./llama-cli -m llama-3-indian-gender.Q4_K_M.gguf -p "### Instruction: Identify the gender. ### Input: Rajesh ### Response:"
- Ollama: Create a Modelfile with the following content:
FROM ./llama-3-indian-gender.Q4_K_M.gguf
TEMPLATE """### Instruction:
Identify the gender of the given Indian name.
### Input:
{{ .Prompt }}
### Response:
"""
3. LoRA Adapters (Unsloth) -
Use this if you want to load the adapters on top of the base Llama-3 model dynamically.
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "shisha-07/Llama-3-Indian-Gender-Classifier",
subfolder = "LoRA", # Specific folder for adapters
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
# ... Run inference as usual
๐ ๏ธ Training Details
Base Architecture: Llama-3-8B-bnb-4bit
Fine-Tuning Method: QLoRA (via Unsloth)
Dataset: Custom dataset of Indian names labeled by gender.
Infrastructure: Trained on Tesla T4 GPU (Google Colab)
๐ License
Apache-2.0
- Downloads last month
- 6
4-bit
Model tree for shisha-07/Llama-3-Indian-Gender-Classifier
Base model
meta-llama/Meta-Llama-3-8BDataset used to train shisha-07/Llama-3-Indian-Gender-Classifier
Evaluation results
- accuracy on shisha-07/Indian_Names_with_Gender_Datasetself-reported0.864
- f1 on shisha-07/Indian_Names_with_Gender_Datasetself-reported0.836
