MCPcopy Create free account
hub / github.com/ZinYY/TreeLoRA / parse_args

Function parse_args

inference/ICL.py:127–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125 return self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
126
127def parse_args():
128 def list_of_strings(arg):
129 return arg.split(',')
130 parser = argparse.ArgumentParser(
131 description=
132 "Finetune a transformers model on a causal language modeling task")
133 parser.add_argument('--data_path',
134 type=str,
135 default='Dahoas/rm-static',
136 help='Path to the training dataset. A single data path.')
137 parser.add_argument('--dataset_name',
138 type=list_of_strings,
139 default='all',
140 help='Dataset to be used.')
141 parser.add_argument(
142 '--data_output_path',
143 type=str,
144 default='./tmp/data_files/',
145 help=
146 'Where to store the data-related files such as shuffle index. This needs to be on a local storage of a node (not on a shared storage)'
147 )
148 parser.add_argument(
149 "--model_name_or_path",
150 type=str,
151 help=
152 "Path to pretrained model or model identifier from huggingface.co/models.",
153 required=True,
154 )
155
156 parser.add_argument(
157 "--max_prompt_len",
158 type=int,
159 default=512,
160 help="The maximum sequence length.",
161 )
162 # inference params
163 parser.add_argument(
164 "--max_ans_len",
165 type=int,
166 default=256,
167 help="The maximum answer length.",
168 )
169 parser.add_argument(
170 "--temperature",
171 type=float,
172 default=0.1,
173 help="Generate temperature params.",
174 )
175 parser.add_argument(
176 "--inference_batch",
177 type=int,
178 default=4,
179 help="Inference batch size.",
180 )
181
182 parser.add_argument("--output_dir",
183 type=str,
184 default=None,

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected