Views
No views yet
ai-ml-t-tes2-dftopcat-data-dsr1-1.5bfacebook/opt-1.3b 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). Compared to the previous model (ai-ml-t-tes1-dftopcat-data-dsr1-1.5b), this version uses a larger base model and improved training parameters to generate more coherent and informative responses about Ayurvedic principles and their role in promoting health.facebook/opt-1.3b 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.facebook/opt-350m), this version demonstrates significant improvements in coherence, reduced repetition, and fewer inaccuracies. However, it still struggles with depth and specificity, particularly in explaining Vata, Pitta, and Kapha doshas in detail.repetition_penalty) have significantly reduced redundant phrases.facebook/opt-1.3b) has led to more structured and logical responses.facebook/opt-6.7b) for improved performance.1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel, PeftConfig
3import torch
4
5# Load the base model
6base_model = AutoModelForCausalLM.from_pretrained(
7 "facebook/opt-1.3b", # Original base model
8 torch_dtype=torch.float16,
9 device_map="auto"
10)
11
12# Load the LoRA configuration and adapter
13peft_config = PeftConfig.from_pretrained("kas1/ai-ml-t-tes2-dftopcat-data-dsr1-1.5b")
14model = PeftModel.from_pretrained(base_model, "kas1/ai-ml-t-tes2-dftopcat-data-dsr1-1.5b")
15
16# Load the tokenizer
17tokenizer = AutoTokenizer.from_pretrained("kas1/ai-ml-t-tes2-dftopcat-data-dsr1-1.5b")
18tokenizer.pad_token = tokenizer.eos_token
19
20# Generate text
21def generate_text(prompt, max_new_tokens=500):
22 inputs = tokenizer(prompt, return_tensors="pt").to('cuda')
23 with torch.no_grad():
24 output = model.generate(
25 **inputs,
26 max_new_tokens=max_new_tokens,
27 do_sample=True,
28 temperature=0.4,
29 top_k=25,
30 top_p=0.87,
31 repetition_penalty=1.3
32 )
33 return tokenizer.decode(output[0], skip_special_tokens=True)
34
35# Test the model
36prompt = "Ayurveda emphasizes the balance between doshas. How can understanding our doshic constitution promote better health?"
37output = generate_text(prompt)
38print(output)