Spaces:
Running
Running
File size: 585 Bytes
03f2ff2 7d6b4cd 5eff19f 03f2ff2 5eff19f 7d6b4cd 5eff19f 5044df2 5eff19f 7665fc0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import os
import torch
from evo_model import EvoTransformerForClassification, EvoTransformerConfig
# β
Create directory if it doesn't exist
os.makedirs("trained_model", exist_ok=True)
# β
Create config and model
config = EvoTransformerConfig()
model = EvoTransformerForClassification(config)
# β
Save like Hugging Face expects
torch.save(model.state_dict(), "trained_model/pytorch_model.bin")
# β
Save minimal config
with open("trained_model/config.json", "w") as f:
f.write(config.to_json_string())
print("β
EvoTransformer initial model saved to 'trained_model/'")
|