leochen085 commited on
Commit
117e0c8
·
verified ·
1 Parent(s): 16640e7

Init Gemma in float32, users control dtype via torch_dtype param

Browse files
Files changed (1) hide show
  1. modeling_slip.py +1 -0
modeling_slip.py CHANGED
@@ -433,6 +433,7 @@ class Gemma3MultimodalModel(nn.Module):
433
  model_id, trust_remote_code=True)
434
  else:
435
  config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
 
436
  self.model = AutoModelForCausalLM.from_config(
437
  config, trust_remote_code=True)
438
 
 
433
  model_id, trust_remote_code=True)
434
  else:
435
  config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
436
+ config.torch_dtype = torch.float32
437
  self.model = AutoModelForCausalLM.from_config(
438
  config, trust_remote_code=True)
439