Skip to content

Commit b532a69

Browse files
committed
convert.py : use dir name to name the llama
1 parent c90d135 commit b532a69

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

convert.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,12 @@ def __init__(self, fname_out: Path) -> None:
811811

812812
def add_meta_arch(self, params: Params) -> None:
813813
name = "LLaMA"
814+
815+
# TODO: better logic to determine model name
814816
if (params.n_ctx == 4096):
815817
name = "LLaMA v2"
816-
if params.path_model:
817-
name = str(params.path_model.parent).split('/')[-1]
818+
elif params.path_model:
819+
name = str(params.path_model.parent).split('/')[-1]
818820

819821
self.gguf.add_name (name)
820822
self.gguf.add_context_length (params.n_ctx)
@@ -839,8 +841,7 @@ def add_meta_vocab(self, vocab: Vocab) -> None:
839841
tokens = []
840842
scores = []
841843
toktypes = []
842-
# NOTE: `all_tokens` returns the the base vocabulary and added tokens
843-
# TODO: add special tokens?
844+
# NOTE: `all_tokens` returns the base vocabulary and added tokens
844845
for text, score, toktype in vocab.all_tokens():
845846
tokens.append(text)
846847
scores.append(score)

0 commit comments

Comments
 (0)