refactor: Add function for building and parsing CLI arguments
This commit is contained in:
parent
e9759dee0b
commit
f30bd63252
1 changed files with 6 additions and 2 deletions
|
@ -42,7 +42,7 @@ from gguf.huggingface_hub import HFHubModel, HFHubTokenizer
|
||||||
logger = logging.getLogger(Path(__file__).stem)
|
logger = logging.getLogger(Path(__file__).stem)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def get_arguments() -> argparse.Namespace:
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("auth_token", help="A huggingface read auth token")
|
parser.add_argument("auth_token", help="A huggingface read auth token")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -63,7 +63,11 @@ def main():
|
||||||
choices=["SPM", "BPE", "WPM"],
|
choices=["SPM", "BPE", "WPM"],
|
||||||
help="The name of the vocab type. Default is 'BPE'.",
|
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:
|
if args.verbose:
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue