steveyu323 commited on
Commit
45781e0
·
verified ·
1 Parent(s): e1bca72

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. config.json +20 -30
config.json CHANGED
@@ -1,30 +1,20 @@
1
- from modeling import KinaseSubstrateConfig, KinaseSubstrateModel
2
- import torch
3
-
4
- # Build config
5
- config = KinaseSubstrateConfig(
6
- tape_model_name="bert-base",
7
- num_labels=2,
8
- threshold=ckpt["threshold"], # from your checkpoint
9
- with_sep=True,
10
- max_len=1024,
11
- # Tell HF where to find the custom classes:
12
- auto_map={
13
- "AutoConfig": "modeling.KinaseSubstrateConfig",
14
- "AutoModel": "modeling.KinaseSubstrateModel",
15
- },
16
- custom_pipelines={
17
- "kinase-substrate": {
18
- "impl": "pipeline.KinaseSubstratePipeline",
19
- "pt": ["AutoModel"],
20
- }
21
- },
22
- )
23
-
24
- # Build and load model
25
- model = KinaseSubstrateModel(config)
26
- model.backbone.load_state_dict(ckpt["state_dict"]) # load your trained weights
27
-
28
- # Save
29
- model.save_pretrained("./my_kinase_model")
30
- config.save_pretrained("./my_kinase_model")
 
1
+ {
2
+ "model_type": "kinase_substrate_bert",
3
+ "tape_model_name": "bert-base",
4
+ "num_labels": 2,
5
+ "threshold": 0.7734375,
6
+ "with_sep": true,
7
+ "max_len": 1024,
8
+ "auto_map": {
9
+ "AutoConfig": "modeling.KinaseSubstrateConfig",
10
+ "AutoModel": "modeling.KinaseSubstrateModel"
11
+ },
12
+ "custom_pipelines": {
13
+ "kinase-substrate": {
14
+ "impl": "pipeline.KinaseSubstratePipeline",
15
+ "pt": [
16
+ "AutoModel"
17
+ ]
18
+ }
19
+ }
20
+ }