thunderjr commited on
Commit
0c5fb08
·
verified ·
1 Parent(s): 428bf63

Upload main.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. main.py +8 -0
main.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from transformers import Gemma3nForConditionalGeneration
2
+ import torch
3
+
4
+ model_id = "google/gemma-3n-e4b-it"
5
+
6
+ model = Gemma3nForConditionalGeneration.from_pretrained(model_id, device_map="auto", dtype=torch.bfloat16).eval()
7
+ torch.save(model.state_dict(), f"{model_id.split("/")[1]}.bin")
8
+