copper-light commited on
Commit
55413d4
·
1 Parent(s): 09566db
auto.ipynb ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "558ced93",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": []
10
+ }
11
+ ],
12
+ "metadata": {
13
+ "language_info": {
14
+ "name": "python"
15
+ }
16
+ },
17
+ "nbformat": 4,
18
+ "nbformat_minor": 5
19
+ }
config.json/config.json CHANGED
@@ -1,4 +1,7 @@
1
  {
 
 
 
2
  "input_dim": 4,
3
  "model_type": "test-model",
4
  "output_dim": 16,
 
1
  {
2
+ "auto_map": {
3
+ "AutoConfig": "model.TestConfig"
4
+ },
5
  "input_dim": 4,
6
  "model_type": "test-model",
7
  "output_dim": 16,
pytorch_model.bin/model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:05a3301854d248873c8f006dd97769830f867377aaf0a58821d1e0330b3d2e0d
3
  size 496
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:456fdf360a6885691c2e9a7da8262857e3d415c36f57abf4224941b954ec7580
3
  size 496
train.py CHANGED
@@ -1,5 +1,5 @@
1
  import torch
2
- from transformers import (WEIGHTS_NAME, CONFIG_NAME)
3
 
4
  from model import (TestConfig, TestModel)
5
 
@@ -14,5 +14,7 @@ if __name__ == "__main__":
14
  pred = model(x)
15
  print(pred)
16
 
 
 
17
  config.save_pretrained(CONFIG_NAME)
18
  model.save_pretrained(WEIGHTS_NAME)
 
1
  import torch
2
+ from transformers import (WEIGHTS_NAME, CONFIG_NAME, AutoConfig)
3
 
4
  from model import (TestConfig, TestModel)
5
 
 
14
  pred = model(x)
15
  print(pred)
16
 
17
+ AutoConfig.register("test-model", TestConfig)
18
+
19
  config.save_pretrained(CONFIG_NAME)
20
  model.save_pretrained(WEIGHTS_NAME)