Skip to content

Commit 3637065

Browse files
committed
Moved model inv check earlier
1 parent 1b9f406 commit 3637065

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

cli.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ def _add_evaluation_args(parser) -> None:
319319
)
320320

321321

322-
# TODO: Refactor arg_init to be more modular
323322
def arg_init(args):
324323
if not (torch.__version__ > "2.3"):
325324
raise RuntimeError(
@@ -329,11 +328,6 @@ def arg_init(args):
329328
if sys.version_info.major != 3 or sys.version_info.minor < 10:
330329
raise RuntimeError("Please use Python 3.10 or later.")
331330

332-
# TODO: Don't initialize for Inventory management subcommands
333-
# Remove when arg_init is refactored
334-
if args.command in INVENTORY_VERBS:
335-
return args
336-
337331
if hasattr(args, "quantize") and Path(args.quantize).is_file():
338332
with open(args.quantize, "r") as f:
339333
args.quantize = json.loads(f.read())

torchchat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from cli import (
1313
add_arguments_for_verb,
1414
KNOWN_VERBS,
15+
INVENTORY_VERBS,
1516
arg_init,
1617
check_args,
1718
)
@@ -49,7 +50,11 @@
4950

5051
# Now parse the arguments
5152
args = parser.parse_args()
52-
args = arg_init(args)
53+
54+
# Don't initialize for Inventory management subcommands
55+
# TODO: Remove when arg_init is refactored
56+
if args.command not in INVENTORY_VERBS:
57+
args = arg_init(args)
5358
logging.basicConfig(
5459
format="%(message)s", level=logging.DEBUG if args.verbose else logging.INFO
5560
)

0 commit comments

Comments
 (0)