mrrtmob commited on
Commit
731d214
·
1 Parent(s): 7b6bd08

Refactor model loading to remove device_map and manually move model to device

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -66,13 +66,13 @@ snapshot_download(
66
  print("Model files downloaded successfully")
67
 
68
  print("Loading main model...")
69
- # Load model and tokenizer with token
70
  model = AutoModelForCausalLM.from_pretrained(
71
  model_name,
72
  torch_dtype=torch.bfloat16,
73
- token=hf_token,
74
- device_map="auto"
75
  )
 
76
 
77
  print("Loading tokenizer...")
78
  tokenizer = AutoTokenizer.from_pretrained(
 
66
  print("Model files downloaded successfully")
67
 
68
  print("Loading main model...")
69
+ # Load model and tokenizer with token (removed device_map)
70
  model = AutoModelForCausalLM.from_pretrained(
71
  model_name,
72
  torch_dtype=torch.bfloat16,
73
+ token=hf_token
 
74
  )
75
+ model = model.to(device) # Move to device manually
76
 
77
  print("Loading tokenizer...")
78
  tokenizer = AutoTokenizer.from_pretrained(