refactor: Add function for building and parsing CLI arguments

This commit is contained in:
teleprint-me 2024-05-25 14:41:13 -04:00
parent e9759dee0b
commit f30bd63252
No known key found for this signature in database
GPG key ID: B0D11345E65C4D48

View file

@ -42,7 +42,7 @@ from gguf.huggingface_hub import HFHubModel, HFHubTokenizer
logger = logging.getLogger(Path(__file__).stem)
def main():
def get_arguments() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("auth_token", help="A huggingface read auth token")
parser.add_argument(
@ -63,7 +63,11 @@ def main():
choices=["SPM", "BPE", "WPM"],
help="The name of the vocab type. Default is 'BPE'.",
)
args = parser.parse_args()
return parser.parse_args()
def main():
args = get_arguments()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)