Skip to content

Commit

Permalink
convert.py : use dir name to name the llama
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Aug 30, 2023
1 parent c90d135 commit b532a69
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,12 @@ def __init__(self, fname_out: Path) -> None:

def add_meta_arch(self, params: Params) -> None:
name = "LLaMA"

# TODO: better logic to determine model name
if (params.n_ctx == 4096):
name = "LLaMA v2"
if params.path_model:
name = str(params.path_model.parent).split('/')[-1]
elif params.path_model:
name = str(params.path_model.parent).split('/')[-1]

self.gguf.add_name (name)
self.gguf.add_context_length (params.n_ctx)
Expand All @@ -839,8 +841,7 @@ def add_meta_vocab(self, vocab: Vocab) -> None:
tokens = []
scores = []
toktypes = []
# NOTE: `all_tokens` returns the the base vocabulary and added tokens
# TODO: add special tokens?
# NOTE: `all_tokens` returns the base vocabulary and added tokens
for text, score, toktype in vocab.all_tokens():
tokens.append(text)
scores.append(score)
Expand Down

0 comments on commit b532a69

Please sign in to comment.