Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 2aa67b4

Browse files
author
anirudh
committed
[wip] Added cli args and other changes to eval multi-modal models
1 parent 2766a95 commit 2aa67b4

File tree

4 files changed

+339
-4
lines changed

4 files changed

+339
-4
lines changed

install/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ streamlit
3434
flask
3535

3636
# eval
37-
lm_eval==0.4.2
37+
lm_eval==0.4.5

torchchat/cli/builder.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class BuilderArgs:
7171
dynamic_shapes: bool = False
7272
max_seq_length: Optional[int] = None
7373
attention_backend: str = "math"
74+
modality: Optional[str] = "text"
7475

7576
def __post_init__(self):
7677
if self.device is None:
@@ -146,6 +147,10 @@ def from_args(cls, args: argparse.Namespace) -> "BuilderArgs":
146147
aoti_package_path = getattr(args, "aoti_package_path", None)
147148
snapshot_path = getattr(args, "snapshot_path", None)
148149

150+
modality = "text"
151+
if args.modality:
152+
modality = args.modality
153+
149154
is_chat_model = False
150155
if args.is_chat_model:
151156
is_chat_model = True
@@ -222,6 +227,7 @@ def from_args(cls, args: argparse.Namespace) -> "BuilderArgs":
222227
chpt_from=chpt_from,
223228
distribution_path=distribution_path,
224229
is_chat_model=is_chat_model,
230+
modality=modality,
225231
dynamic_shapes=getattr(args, "dynamic_shapes", False),
226232
max_seq_length=getattr(args, "max_seq_length", None),
227233
attention_backend=attention_backend,

torchchat/cli/cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ def _add_model_specification_args(parser) -> None:
137137
help=argparse.SUPPRESS,
138138
)
139139

140+
model_specification_parser.add_argument(
141+
"--modality",
142+
type=str,
143+
default="text",
144+
choices=["text", "text-image"],
145+
# help=argparse.SUPPRESS,
146+
help="Modality of the model. Options: text, text-image",
147+
# help="Modality of the model. Options: text, text-image",
148+
)
149+
140150

141151
# Add CLI Args related to model configuration (compilation, quant, etc)
142152
# Excludes compile args if subcommand is export

0 commit comments

Comments
 (0)