HemanM commited on
Commit
03f2ff2
·
verified ·
1 Parent(s): 480dd1d

Create init_save.py

Browse files
Files changed (1) hide show
  1. init_save.py +8 -4
init_save.py CHANGED
@@ -1,12 +1,16 @@
1
  # init_save.py
2
 
 
 
3
  from evo_model import EvoTransformerForClassification, EvoTransformerConfig
4
 
5
- # Step 1: Create the config and model
 
 
 
6
  config = EvoTransformerConfig()
7
  model = EvoTransformerForClassification(config)
8
 
9
- # Step 2: Save properly to 'trained_model' directory
10
  model.save_pretrained("trained_model")
11
-
12
- print("✅ EvoTransformer base model and config saved to trained_model/")
 
1
  # init_save.py
2
 
3
+ import os
4
+ import torch
5
  from evo_model import EvoTransformerForClassification, EvoTransformerConfig
6
 
7
+ # Ensure the directory exists
8
+ os.makedirs("trained_model", exist_ok=True)
9
+
10
+ # Create config and model instance
11
  config = EvoTransformerConfig()
12
  model = EvoTransformerForClassification(config)
13
 
14
+ # Save initial model and config
15
  model.save_pretrained("trained_model")
16
+ print("✅ Initial EvoTransformer saved to trained_model/")