addcorpbc commited on
Commit ·
78a67fb
1
Parent(s): a5aa51c
Remove CUDA/Quantization dependencies and ensure CPU compatibility
Browse files11 unmodified lines121314151617181920212223242526272811 unmodified linescache_dir = "./model_cache"os.makedirs(cache_dir, exist_ok=True)# Load pre-trained model and tokenizertokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf", cache_dir=cache_dir, use_auth_token=hf_token)model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf",device_map="auto", # Automatically map layers to available hardware (CPU here)load_in_8bit=True, # Enable quantization for better performancecache_dir=cache_dir,use_auth_token=hf_token # Pass the token for authenticated model loading)# Fine-tuning data file pathstrain_file_paths = ["C:/Users/addco/Desktop/Magic CIty Training/Quizes/quizes json files/Card Sorting","C:/Users/addco/Desktop/Magic CIty Training/Quizes/quizes json files/MBPTI",11 unmodified lines1213141516171819202122232425262711 unmodified linescache_dir = "./model_cache"os.makedirs(cache_dir, exist_ok=True)# Load pre-trained model and tokenizer (without 8-bit quantization)tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf", cache_dir=cache_dir, use_auth_token=hf_token)model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf",device_map="auto", # Automatically map layers to available hardware (CPU here)cache_dir=cache_dir,use_auth_token=hf_token # Pass the token for authenticated model loading)# Fine-tuning data file paths (updated to the five provided files)train_file_paths = ["C:/Users/addco/Desktop/Magic CIty Training/Quizes/quizes json files/Card Sorting","C:/Users/addco/Desktop/Magic CIty Training/Quizes/quizes json files/MBPTI",
app.py+2-3