Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion auto_round/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@
class BasicArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_argument(
"model",
default=None,
nargs="?",
help="Path to the pre-trained model or model identifier from huggingface.co/models. "
"Examples: 'facebook/opt-125m', 'bert-base-uncased', or local path like '/path/to/model'",
)
basic = self.add_argument_group("Basic Arguments")
basic.add_argument(
"--model",
"--model_name",
"--model",
"--model_name_or_path",
default="facebook/opt-125m",
help="Path to the pre-trained model or model identifier from huggingface.co/models. "
Expand Down Expand Up @@ -433,6 +440,9 @@ def setup_parser(recipe="default"):


def tune(args):
assert args.model or args.model_name, "[model] or --model MODEL_NAME should be set."
if args.model is None:
args.model = args.model_name
if args.eval_bs is None:
args.eval_bs = "auto"
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
Expand Down Expand Up @@ -785,6 +795,9 @@ def setup_eval_parser():

def run_eval():
args = setup_eval_parser()
assert args.model or args.model_name, "[model] or --model MODEL_NAME should be set."
if args.model is None:
args.model = args.model_name
if args.eval_task_by_task:
eval_task_by_task(
model=args.model,
Expand Down
9 changes: 8 additions & 1 deletion auto_round/eval/eval_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ class EvalArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_argument(
"--model",
"model",
default=None,
nargs="?",
help="Path to the pre-trained model or model identifier from huggingface.co/models. "
"Examples: 'facebook/opt-125m', 'bert-base-uncased', or local path like '/path/to/model'",
)
self.add_argument(
"--model_name",
"--model",
"--model_name_or_path",
default="facebook/opt-125m",
help="Path to the pre-trained model or model identifier from huggingface.co/models. "
Expand Down