GoldenLoongAS commited on
Commit
bb6b42a
·
verified ·
1 Parent(s): 4973bd1

Create tests/test_all.py

Browse files
Files changed (1) hide show
  1. tests/test_all.py +14 -0
tests/test_all.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import sys, os
3
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
4
+ from transformers import AutoTokenizer, AutoConfig
5
+
6
+ def test_load():
7
+ MODEL_DIR = os.path.dirname(os.path.abspath(__file__ + "/.."))
8
+ tok = AutoTokenizer.from_pretrained(MODEL_DIR, trust_remote_code=True)
9
+ cfg = AutoConfig.from_pretrained(MODEL_DIR)
10
+ assert cfg.vocab_size == 64000
11
+ print("✅ 公开文件加载成功")
12
+
13
+ if __name__ == "__main__":
14
+ test_load()