Skip to content

Commit 307fc4e

Browse files
committed
fix: review cmt - error when tp_plan not set for tp_size
Signed-off-by: Mehant Kammakomati <[email protected]>
1 parent c2d3843 commit 307fc4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/transformers/modeling_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3961,7 +3961,8 @@ def from_pretrained(
39613961
raise ValueError(
39623962
"`state_dict` cannot be passed together with a model name or a `gguf_file`. Use one of the two loading strategies."
39633963
)
3964-
3964+
if tp_size is not None and tp_plan is None:
3965+
raise ValueError(f"tp_plan has to be set when tp_size is passed.")
39653966
if tp_plan is not None and tp_plan != "auto":
39663967
# TODO: we can relax this check when we support taking tp_plan from a json file, for example.
39673968
raise ValueError(f"tp_plan supports 'auto' only for now but got {tp_plan}.")

0 commit comments

Comments
 (0)