addcorpbc commited on
Commit ·
908a078
1
Parent(s): 821a209
Switch model loading to CPU
Browse files17 unmodified lines181920212223242517 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 performancedevice_map="auto", # Automatically map layers to available hardwarecache_dir=cache_dir,use_auth_token=hf_token # Pass the token for authenticated model loading)17 unmodified lines1819202122232417 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",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