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.
This repository is organized into three specific folders to keep files clean. Please select the folder that matches your use case:
Use this method if you are running a script or a web server. Note: You must specify subfolder="Merged".
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4# 1. Load from the 'Merged' folder
5model_id = "shisha-07/Llama-3-Indian-Gender-Classifier"
6tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="Merged")
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 subfolder="Merged",
10 device_map="auto",
11 torch_dtype=torch.float16
12)
13
14# 2. Define the Prompt (Alpaca Format)
15prompt_template = """### Instruction:
16Identify the gender of the given Indian name.
17
18### Input:
19{}
20
21### Response:
22"""
23
24# 3. Run Inference
25name = "Ananya"
26inputs = tokenizer(prompt_template.format(name), return_tensors="pt").to("cuda")
27output = model.generate(**inputs, max_new_tokens=10)
28
29print(tokenizer.decode(output[0], skip_special_tokens=True))
30# Output: Female
1FROM ./llama-3-indian-gender.Q4_K_M.gguf
2TEMPLATE """### Instruction:
3Identify the gender of the given Indian name.
4
5### Input:
6{{ .Prompt }}
7
8### Response:
9"""
Use this if you want to load the adapters on top of the base Llama-3 model dynamically.
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "shisha-07/Llama-3-Indian-Gender-Classifier",
5 subfolder = "LoRA", # Specific folder for adapters
6 load_in_4bit = True,
7)
8FastLanguageModel.for_inference(model)
9
10# ... Run inference as usual
-
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)