arunb74/llama-3.2-3b-nhm-production
Llama 3.2 3B NHM Production
A PEFT/LoRA fine-tuned adapter based on Meta Llama 3.2 3B Instruct.
This model is intended for multilingual NLP tasks related to the NHM (National Health Mission) use case.
Important: This repository contains the LoRA/PEFT adapter, not the complete base model weights. The base model meta-llama/Llama-3.2-3B-Instruct is required to use this adapter.Model Details
- Base model:
meta-llama/Llama-3.2-3B-Instruct - Model type: PEFT / LoRA adapter
- Architecture: Llama 3.2 3B Instruct
- Fine-tuning method: LoRA
- Framework: Hugging Face Transformers + PEFT
- Task: Multilingual text generation / instruction following
- Repository type: Fine-tuned adapter
- Status: Production adapter
Repository Contents
This repository contains:
adapter_config.json
adapter_model.safetensors
chat_template.jinja
special_tokens_map.json
tokenizer_config.json
tokenizer.json
README.mdThe large original Llama model weights are not included in this repository.
Base Model
The adapter was fine-tuned from:
meta-llama/Llama-3.2-3B-Instruct
The base model is gated by Meta on Hugging Face. Users must have the required access to the base model before loading this adapter.
Usage
Requirements
Install the required Python packages:
pip install torch transformers peft accelerateLoad the Adapter
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
adapter_id = "arunb74/llama32-3b-nhm-production"
tokenizer = AutoTokenizer.from_pretrained(
base_model_id
)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(
base_model,
adapter_id
)
model.eval()Generate Text
messages = [
{
"role": "user",
"content": "Your question here"
}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=256,
temperature=0.7,
do_sample=True
)
response = tokenizer.decode(
outputs[0][inputs.shape[-1]:],
skip_special_tokens=True
)
print(response)Multilingual Usage
This adapter is designed for multilingual use cases. The actual supported languages and performance depend on the training data and fine-tuning configuration.
Example:
messages = [
{
"role": "user",
"content": "Enter your multilingual NHM-related question here."
}
]Use the same language as the input when multilingual response behavior is desired.
Fine-Tuning
This model was fine-tuned using the LoRA (Low-Rank Adaptation) approach through Hugging Face PEFT.
Only the adapter parameters are stored in this repository.
The resulting adapter is approximately:
adapter_model.safetensors
~18 MBThis is significantly smaller than the original Llama 3.2 3B model because the full base model weights are not duplicated.
Adapter Configuration
The adapter configuration is stored in:
adapter_config.jsonThe adapter should be loaded on top of the corresponding base model:
meta-llama/Llama-3.2-3B-InstructDo not load the adapter as if it were a standalone causal language model.
Training Data
The adapter was fine-tuned for an NHM-related multilingual use case.
Specific training dataset details, including dataset size, language distribution, preprocessing, and licensing, should be documented separately if applicable.
Evaluation
Evaluation should be performed against the intended NHM multilingual production tasks.
Recommended evaluation dimensions include:
- Response correctness
- Instruction following
- Multilingual performance
- Factual consistency
- Relevance
- Safety
- Hallucination rate
- Response quality
- Performance across supported languages
No standardized benchmark results are currently provided in this model card.
Limitations
This model inherits limitations from the underlying Llama 3.2 3B Instruct model and may also introduce additional limitations from the fine-tuning data.
Potential limitations include:
- Hallucinated information
- Incorrect or incomplete answers
- Uneven performance across languages
- Sensitivity to prompt wording
- Domain-specific errors
- Potential biases present in the training data
- Reduced performance on tasks outside the fine-tuning domain
The model should not be assumed to provide authoritative medical, legal, financial, or other high-stakes advice.
Intended Use
This model is intended for:
- NHM-related multilingual NLP applications
- Research and development
- Internal testing
- Prototyping
- Domain-specific text generation
- Multilingual instruction-following applications
For production applications, responses should be appropriately validated and monitored.
Out-of-Scope Use
This model should not be used as the sole decision-making system for:
- Medical diagnosis
- Medical treatment decisions
- Emergency medical decisions
- Legal decisions
- Financial decisions
- Any other high-stakes automated decision
Human review and appropriate domain-specific safeguards should be used where necessary.
Hardware and Software
Base Model
Meta Llama 3.2 3B InstructFine-Tuning Framework
Hugging Face PEFTPEFT Version
0.10.0The exact hardware, training duration, batch size, learning rate, number of epochs, and other training parameters should be added here if available.
License
The base model is subject to the license and usage terms provided by Meta for Llama 3.2.
Users should review and comply with the applicable Llama 3.2 license and acceptable-use requirements before using the model.
This adapter repository does not replace the licensing requirements of the base model.
Citation
If you use this adapter in research or an application, please cite the underlying Llama model and the relevant project or dataset documentation.
Acknowledgements
This model is based on:
Meta Llama 3.2 3B Instruct
and uses the Hugging Face PEFT framework for parameter-efficient fine-tuning.
Contact
For questions regarding this adapter or the associated NHM multilingual project, please refer to the project documentation and repository maintainers.
