Model Card for ai-ml-t-tes1-dftopcat-data-dsr1-1.5b
This is a fine-tuned version of the facebook/opt-350m
model using the LoRA (Low-Rank Adaptation) technique. The model has been trained on a dataset focused on Ayurveda and the concept of doshas (Vata, Pitta, Kapha). It aims to generate coherent and informative responses about Ayurvedic principles and their role in promoting health.
Model Details
Model Description
This model is a fine-tuned adaptation of the facebook/opt-350m
base model, optimized for generating explanations related to Ayurveda and doshas. It uses the LoRA technique to reduce computational costs while maintaining performance. The training data consists of instructional prompts and corresponding outputs that explain Ayurvedic concepts like doshic constitution, balance, and their influence on health.
- Developed by: kas1
- Model type: Causal Language Model (Fine-Tuned)
- Language(s): English
- License: MIT License
- Finetuned from model: facebook/opt-350m
Model Sources
- Repository: kas1/ai-ml-t-tes1-dftopcat-data-dsr1-1.5b
- Dataset: Abhaykoul/Ancient-Indian-Wisdom
Uses
Direct Use
The model can be used to generate responses to questions about Ayurveda, particularly focusing on doshas and their role in health. It is suitable for educational purposes, answering FAQs, or providing introductory insights into Ayurvedic principles.
Downstream Use
The model can be integrated into applications like chatbots, virtual assistants, or educational platforms that focus on alternative medicine and wellness.
Out-of-Scope Use
The model is not designed for medical diagnosis, treatment recommendations, or generating content outside the scope of Ayurveda. Misuse or reliance on the model for critical health decisions is strongly discouraged.
Bias, Risks, and Limitations
Known Limitations
- The model occasionally generates repetitive or nonsensical phrases, especially when generation parameters are not carefully tuned.
- Responses may lack depth or specificity about Vata, Pitta, and Kapha doshas compared to expert-level explanations.
- The model sometimes introduces inaccuracies (e.g., "doshas as hallucinations") due to limitations in training data or fine-tuning.
Recommendations
- Use post-processing techniques to filter out irrelevant or inaccurate statements.
- Fine-tune the model further with more diverse and high-quality training data.
- Experiment with larger base models (e.g.,
facebook/opt-1.3b
) for improved performance.
How to Get Started with the Model
To use this model, follow these steps:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel, PeftConfig
# Load the base model
base_model = AutoModelForCausalLM.from_pretrained(
"facebook/opt-350m", # Original base model
torch_dtype=torch.float16,
device_map="auto"
)
# Load the LoRA configuration and adapter
peft_config = PeftConfig.from_pretrained("kas1/ai-ml-t-tes1-dftopcat-data-dsr1-1.5b")
model = PeftModel.from_pretrained(base_model, "kas1/ai-ml-t-tes1-dftopcat-data-dsr1-1.5b")
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("kas1/ai-ml-t-tes1-dftopcat-data-dsr1-1.5b")
tokenizer.pad_token = tokenizer.eos_token
# Generate text
def generate_text(prompt, max_new_tokens=1000):
inputs = tokenizer(prompt, return_tensors="pt").to('cuda')
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
do_sample=True,
temperature=0.3,
top_k=20,
top_p=0.8,
repetition_penalty=1.3
)
return tokenizer.decode(output[0], skip_special_tokens=True)
# Test the model
prompt = "Ayurveda emphasizes the balance between doshas. How can understanding our doshic constitution promote better health?"
output = generate_text(prompt)
print(output)