mannadamay12 commited on
Commit
2261a7d
·
verified ·
1 Parent(s): 988c5f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -55,8 +55,12 @@ def initialize_model():
55
  model = AutoModelForCausalLM.from_pretrained(
56
  model_id,
57
  token=token,
58
- device_map="auto"
59
  )
 
 
 
 
60
 
61
  return model, tokenizer
62
 
 
55
  model = AutoModelForCausalLM.from_pretrained(
56
  model_id,
57
  token=token,
58
+ device_map="cuda"
59
  )
60
+ if torch.cuda.is_available():
61
+ model.device = "cuda"
62
+ else:
63
+ print("CUDA is not available")
64
 
65
  return model, tokenizer
66