summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-08-30 13:29:40 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-08-30 13:29:40 +0300
commitb532a69b2fd08067f34f32f37a2fd9b37678a34a (patch)
tree795789c1993c61dd927ae21f518a86d5998b20b8
parentc90d135eb433cf0d40fb95e46a48d1391d2352b5 (diff)
convert.py : use dir name to name the llama
-rwxr-xr-xconvert.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/convert.py b/convert.py
index 448b6f0f..a7f4c2d7 100755
--- a/convert.py
+++ b/convert.py
@@ -811,10 +811,12 @@ class OutputFile:
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)
@@ -839,8 +841,7 @@ class OutputFile:
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)