mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 05:48:47 +01:00
convert.py : use dir name to name the llama
This commit is contained in:
parent
c90d135eb4
commit
b532a69b2f
@ -811,10 +811,12 @@ class OutputFile:
|
|||||||
|
|
||||||
def add_meta_arch(self, params: Params) -> None:
|
def add_meta_arch(self, params: Params) -> None:
|
||||||
name = "LLaMA"
|
name = "LLaMA"
|
||||||
|
|
||||||
|
# TODO: better logic to determine model name
|
||||||
if (params.n_ctx == 4096):
|
if (params.n_ctx == 4096):
|
||||||
name = "LLaMA v2"
|
name = "LLaMA v2"
|
||||||
if params.path_model:
|
elif params.path_model:
|
||||||
name = str(params.path_model.parent).split('/')[-1]
|
name = str(params.path_model.parent).split('/')[-1]
|
||||||
|
|
||||||
self.gguf.add_name (name)
|
self.gguf.add_name (name)
|
||||||
self.gguf.add_context_length (params.n_ctx)
|
self.gguf.add_context_length (params.n_ctx)
|
||||||
@ -839,8 +841,7 @@ class OutputFile:
|
|||||||
tokens = []
|
tokens = []
|
||||||
scores = []
|
scores = []
|
||||||
toktypes = []
|
toktypes = []
|
||||||
# NOTE: `all_tokens` returns the the base vocabulary and added tokens
|
# NOTE: `all_tokens` returns the base vocabulary and added tokens
|
||||||
# TODO: add special tokens?
|
|
||||||
for text, score, toktype in vocab.all_tokens():
|
for text, score, toktype in vocab.all_tokens():
|
||||||
tokens.append(text)
|
tokens.append(text)
|
||||||
scores.append(score)
|
scores.append(score)
|
||||||
|
Loading…
Reference in New Issue
Block a user