Upload main.py with huggingface_hub
Browse files
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 |
+
|