MCPcopy Create free account
hub / github.com/pytorch/pytorch / main

Function main

scripts/release_notes/classifier.py:385–418  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383
384
385def main():
386 parser = argparse.ArgumentParser(
387 description="Tool to create a classifier for helping to categorize commits"
388 )
389
390 parser.add_argument("--train", action="store_true", help="Train a new classifier")
391 parser.add_argument("--commit_data_folder", default="results/classifier/")
392 parser.add_argument(
393 "--save_path", default="results/classifier/commit_classifier.pt"
394 )
395 parser.add_argument(
396 "--regen_data",
397 action="store_true",
398 help="Regenerate the training data, helps if labeled more examples and want to re-train.",
399 )
400 parser.add_argument(
401 "--resample",
402 action="store_true",
403 help="Resample the training data to be balanced. (Only works if imblearn is installed.)",
404 )
405 args = parser.parse_args()
406
407 if args.train:
408 train(
409 Path(args.save_path),
410 Path(args.commit_data_folder),
411 args.regen_data,
412 args.resample,
413 )
414 return
415
416 print(
417 "Currently this file only trains a new classifier please pass in --train to train a new classifier"
418 )
419
420
421if __name__ == "__main__":

Callers 1

classifier.pyFile · 0.70

Calls 3

PathClass · 0.85
parse_argsMethod · 0.80
trainFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…