addcorpbc commited on
Commit ·
908a078
1
Parent(s): 821a209
Switch model loading to CPU
Browse files17 unmodified lines18192021222122232417 unmodified linestokenizer = 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", load_in_8bit=True, # Enable quantization for better performance device_map="auto", # Automatically map layers to available hardware 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)app.py+1-2