muryshev commited on
Commit
e75cab0
·
verified ·
1 Parent(s): fa89aca

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -1
model.py CHANGED
@@ -9,7 +9,7 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
9
 
10
  model_id = "CohereForAI/c4ai-command-r-v01-4bit"
11
  tokenizer = AutoTokenizer.from_pretrained(model_id, cache_dir=hf_cache_folder)
12
- model = AutoModelForCausalLM.from_pretrained(model_id, cache_dir=hf_cache_folder).to(device)
13
  ## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
14
 
15
 
 
9
 
10
  model_id = "CohereForAI/c4ai-command-r-v01-4bit"
11
  tokenizer = AutoTokenizer.from_pretrained(model_id, cache_dir=hf_cache_folder)
12
+ model = AutoModelForCausalLM.from_pretrained(model_id, cache_dir=hf_cache_folder, device_map="auto")
13
  ## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
14
 
15