KucLab commited on
Commit
38eb83c
·
verified ·
1 Parent(s): 5a66b41

Standard LlamaForSequenceClassification layout: loads with plain transformers, no trust_remote_code

Browse files
Files changed (1) hide show
  1. censer.1 +8 -3
censer.1 CHANGED
@@ -7,7 +7,8 @@ Usage:
7
  censer.1 --help
8
 
9
  Expects censer.py, model.safetensors, config.json and tokenizer.json next to
10
- this file. Get them all with:
 
11
 
12
  hf download KucLab/Censer.1 --local-dir .
13
 
@@ -17,9 +18,13 @@ Requires: torch, tokenizers, safetensors (pip install torch tokenizers safetens
17
  import os
18
  import sys
19
 
20
- sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
 
21
 
22
  from censer import main
23
 
24
  if __name__ == "__main__":
25
- main(sys.argv[1:])
 
 
 
 
7
  censer.1 --help
8
 
9
  Expects censer.py, model.safetensors, config.json and tokenizer.json next to
10
+ this file (they are found automatically, whatever the current directory is).
11
+ Get them all with:
12
 
13
  hf download KucLab/Censer.1 --local-dir .
14
 
 
18
  import os
19
  import sys
20
 
21
+ HERE = os.path.dirname(os.path.abspath(__file__))
22
+ sys.path.insert(0, HERE)
23
 
24
  from censer import main
25
 
26
  if __name__ == "__main__":
27
+ argv = sys.argv[1:]
28
+ if not any(a == "--model-dir" or a.startswith("--model-dir=") for a in argv):
29
+ argv = ["--model-dir", HERE] + argv
30
+ main(argv)