MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / main

Function main

examples/pytorch/bert/run_squad.py:233–496  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231
232
233def main():
234 parser = argparse.ArgumentParser()
235
236 # Required parameters
237 parser.add_argument(
238 "--model_name_or_path",
239 default=None,
240 type=str,
241 required=True,
242 help="Path to pre-trained model or shortcut name",
243 )
244 parser.add_argument(
245 "--output_dir",
246 default=None,
247 type=str,
248 required=True,
249 help="The output directory where the model checkpoints and predictions will be written.",
250 )
251
252 # Other parameters
253 parser.add_argument(
254 "--data_dir",
255 default=None,
256 type=str,
257 help="The input data dir. Should contain the .json files for the task."
258 + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
259 )
260 parser.add_argument(
261 "--train_file",
262 default=None,
263 type=str,
264 help="The input training file. If a data dir is specified, will look for the file there"
265 + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
266 )
267 parser.add_argument(
268 "--predict_file",
269 default=None,
270 type=str,
271 help="The input evaluation file. If a data dir is specified, will look for the file there"
272 + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.",
273 )
274 parser.add_argument(
275 "--config_name", default="", type=str, help="Pretrained config name or path if not the same as model_name"
276 )
277 parser.add_argument(
278 "--tokenizer_name",
279 default="",
280 type=str,
281 help="Pretrained tokenizer name or path if not the same as model_name",
282 )
283 parser.add_argument(
284 "--cache_dir",
285 default="",
286 type=str,
287 help="Where do you want to store the pre-trained models downloaded from s3",
288 )
289
290 parser.add_argument(

Callers 1

run_squad.pyFile · 0.70

Calls 15

to_int8Method · 0.95
to_halfMethod · 0.95
to_bfloat16Method · 0.95
to_cudaMethod · 0.95
EncoderWeightsClass · 0.90
CustomEncoderClass · 0.90
set_seedFunction · 0.70
evaluateFunction · 0.70
deviceMethod · 0.45
from_pretrainedMethod · 0.45
infoMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected