Create README.md
Browse files
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 |
+
```
|