addcorpbc commited on
Commit ·
78a67fb
1
Parent(s): a5aa51c
Remove CUDA/Quantization dependencies and ensure CPU compatibility
Browse files11 unmodified lines1213141515161718192020212223252425262711 unmodified linescache_dir = "./model_cache"os.makedirs(cache_dir, exist_ok=True)
# Load pre-trained model and tokenizer# 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) load_in_8bit=True, # Enable quantization for better performance cache_dir=cache_dir, use_auth_token=hf_token # Pass the token for authenticated model loading)
# Fine-tuning data file paths# 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