MCPcopy Create free account
hub / github.com/boyiwei/alignment-attribution-code / main

Function main

main.py:61–618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60
61def main():
62 parser = argparse.ArgumentParser()
63 parser.add_argument("--model", type=str, default="llama2-7b-chat-hf")
64 parser.add_argument("--model_base", type=str, default="llama2-7b-hf")
65 parser.add_argument(
66 "--seed", type=int, default=0, help="Seed for sampling the calibration data."
67 )
68 parser.add_argument(
69 "--nsamples", type=int, default=128, help="Number of calibration samples."
70 )
71 parser.add_argument(
72 "--sparsity_ratio", type=float, default=0, help="Sparsity level"
73 )
74 parser.add_argument(
75 "--sparsity_type",
76 type=str,
77 choices=["unstructured", "4:8", "2:4"],
78 default="unstructured",
79 )
80 parser.add_argument(
81 "--prune_method",
82 type=str,
83 choices=[
84 "random",
85 "magnitude",
86 "wanda",
87 "sparsegpt",
88 "attention_head",
89 "ablate_mag_seq",
90 "ablate_wanda_seq",
91 "ablate_mag_iter",
92 "ablate_wanda_iter",
93 "search",
94 "wanda_v2",
95 "wandg",
96 "wandg_set_difference",
97 "low_rank",
98 ],
99 )
100 parser.add_argument(
101 "--prune_data",
102 type=str,
103 choices=[
104 "wikitext",
105 "alpaca",
106 "alpaca_cleaned",
107 "alpaca_cleaned_no_safety",
108 "align",
109 "align_short",
110 "misalign",
111 "align_misalign",
112 "misalign_align",
113 "align_short_misalign",
114 "none",
115 ],
116 default="alpaca_cleaned_no_safety",
117 )
118 parser.add_argument("--use_diff", action="store_true")

Callers 1

main.pyFile · 0.70

Calls 15

prune_wandaFunction · 0.90
prune_magnitudeFunction · 0.90
prune_randomFunction · 0.90
prune_sparsegptFunction · 0.90
prune_wanda_v2Function · 0.90
prune_wandgFunction · 0.90
prune_attention_headFunction · 0.90
prune_ablateFunction · 0.90
make_low_rankFunction · 0.90
check_sparsityFunction · 0.90

Tested by

no test coverage detected