]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert.py : use dir name to name the llama
authorGeorgi Gerganov <redacted>
Wed, 30 Aug 2023 10:29:40 +0000 (13:29 +0300)
committerGeorgi Gerganov <redacted>
Wed, 30 Aug 2023 10:29:40 +0000 (13:29 +0300)
convert.py

index 448b6f0f35ba73e9bad5fb2c0a10ee649c981e9d..a7f4c2d75116ae4bd039245ea7dc28d0d939b69e 100755 (executable)
@@ -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)