Skip to content

Commit 21834b9

Browse files
mikekgfbmalfet
authored andcommitted
handle path is None (#303)
1 parent 4ba1ffb commit 21834b9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build/builder.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ def from_args(cls, args): # -> BuilderArgs:
9696
args.pte_path,
9797
args.gguf_path,
9898
]:
99-
path = str(path)
100-
if path.endswith("/"):
101-
path = path[:-1]
102-
path_basename = os.path.basename(path)
103-
if "chat" in path_basename:
104-
is_chat_model = True
99+
if path is not None:
100+
path = str(path)
101+
if path.endswith("/"):
102+
path = path[:-1]
103+
path_basename = os.path.basename(path)
104+
if "chat" in path_basename:
105+
is_chat_model = True
105106

106107
return cls(
107108
checkpoint_dir=checkpoint_dir,

0 commit comments

Comments
 (0)