Graph Machine Learning
Safetensors
yamboo commited on
Commit
7fbfe52
Β·
verified Β·
1 Parent(s): 58ff725

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - yamboo/Griffin_datasets_joint_v65
5
+ - yamboo/Griffin_datasets_single_pretrain_v3
6
+ metrics:
7
+ - accuracy
8
+ - roc_auc
9
+ - mse
10
+ pipeline_tag: graph-ml
11
+ ---
12
+
13
+ # Griffin: Pretrained Checkpoints
14
+
15
+ This repository contains various pretrained checkpoints for the [Griffin model](https://github.com/yanxwb/Griffin).
16
+
17
+ ## Checkpoints
18
+
19
+ The checkpoints are organized as follows:
20
+
21
+ ```bash
22
+ ./checkpoints/
23
+ β”œβ”€β”€ single-completion # Pretrained single table completion model.
24
+ β”œβ”€β”€ single-sft # Pretrained single table SFT model. Used in main experiments.
25
+ └── transfer # Pretrained transfer model. Used in transfer experiments.
26
+ β”œβ”€β”€ commerce-1 # Split name.
27
+ β”œβ”€β”€ FULL # RDB-SFT setting name. This one used in main transfer experiments.
28
+ β”œβ”€β”€ MIXED # RDB-SFT setting name. Used in ablation in RDB-SFT setting.
29
+ └── LIMITED # RDB-SFT setting name. Used in ablation in RDB-SFT setting.
30
+ β”œβ”€β”€ commerce-2 # Same as above.
31
+ β”œβ”€β”€ FULL
32
+ β”œβ”€β”€ MIXED
33
+ └── LIMITED
34
+ β”œβ”€β”€ others-1
35
+ β”œβ”€β”€ FULL
36
+ β”œβ”€β”€ MIXED
37
+ └── LIMITED
38
+ └── others-2
39
+ β”œβ”€β”€ FULL
40
+ β”œβ”€β”€ MIXED
41
+ └── LIMITED
42
+ ```
43
+
44
+ ## How to use
45
+
46
+ To get started, you will need to have the model's architecture defined in your code, provided in [Github Repo](https://github.com/yanxwb/Griffin). You can then use the `huggingface_hub` library to download a specific checkpoint and load its weights.
47
+
48
+ ```python
49
+ import json
50
+ import torch
51
+ from huggingface_hub import hf_hub_download
52
+ import accelerate
53
+
54
+ # Assume 'GriffinModel' is your model's class definition
55
+ # from your_project_position.hmodel import GriffinMod
56
+
57
+ # 1. Define the repository ID and the specific file you want to load
58
+ repo_id = "yamboo/Griffin_models"
59
+ # Example: Loading the main single-table SFT model
60
+ checkpoint_path = "single-sft/model.safetensors"
61
+ config_path = "single-sft/config.json"
62
+
63
+
64
+ # 2. Download the checkpoint file from the Hub
65
+ model_weights_path = hf_hub_download(repo_id=repo_id, filename=checkpoint_path)
66
+ model_config_path = hf_hub_download(repo_id=repo_id, filename=config_path)
67
+ config = json.load(open("config.json", "r"))
68
+
69
+ # 3. Instantiate your model and load the weights. We use accelerate to align with Github repo experiment pipeline.
70
+ model = GriffinMod(**config) # Make sure to pass any required config
71
+ accelerate.load_checkpoint_in_model(model, model_weights_path)
72
+
73
+ ```