vishesh-t27 commited on
Commit
fcad53f
·
verified ·
1 Parent(s): 08631f8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -151,12 +151,13 @@ tokenizer = AutoTokenizer.from_pretrained(
151
  trust_remote_code=True
152
  )
153
 
 
 
154
  model = AutoModelForCausalLM.from_pretrained(
155
  model_name,
156
  trust_remote_code=True,
157
- device_map="auto",
158
- torch_dtype=torch.bfloat16
159
- ).eval()
160
 
161
 
162
  #model.config.kv_cache_mode = "shared" # Use this one if wants to save 50% KV cache, but this will slight more compute
 
151
  trust_remote_code=True
152
  )
153
 
154
+ device = "cuda" if torch.cuda.is_available() else "cpu"
155
+
156
  model = AutoModelForCausalLM.from_pretrained(
157
  model_name,
158
  trust_remote_code=True,
159
+ dtype=torch.bfloat16
160
+ ).to(device).eval()
 
161
 
162
 
163
  #model.config.kv_cache_mode = "shared" # Use this one if wants to save 50% KV cache, but this will slight more compute