Bram Vanroy commited on
Commit
78588de
1 Parent(s): 828458d

add data collection script

Browse files
generate_overview_json.py CHANGED
@@ -2,6 +2,12 @@ from pathlib import Path
2
  import json
3
  from pprint import pprint
4
 
 
 
 
 
 
 
5
 
6
  def main():
7
  results = {}
@@ -32,6 +38,7 @@ def main():
32
  elif "load_in_4bit" in model_args:
33
  results[short_name]["quantization"] = "4-bit"
34
 
 
35
 
36
  pprint(results)
37
 
 
2
  import json
3
  from pprint import pprint
4
 
5
+ from transformers import AutoModelForCausalLM
6
+
7
+
8
+ def get_num_parameters(model_name: str) -> int:
9
+ return AutoModelForCausalLM.from_pretrained(model_name).num_parameters()
10
+
11
 
12
  def main():
13
  results = {}
 
38
  elif "load_in_4bit" in model_args:
39
  results[short_name]["quantization"] = "4-bit"
40
 
41
+ results[short_name]["num_parameters"] = get_num_parameters(model_args["pretrained"])
42
 
43
  pprint(results)
44
 
generate_overview_requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ transformers