]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert : only check for tokenizer folder if we need it (#14704)
authorSigbjørn Skjæret <redacted>
Wed, 16 Jul 2025 06:52:04 +0000 (08:52 +0200)
committerGitHub <redacted>
Wed, 16 Jul 2025 06:52:04 +0000 (08:52 +0200)
convert_hf_to_gguf_update.py

index 9e00df0dc20abb9691170a60a694489e4a05d3d8..6a0d9a9ba566bbf89cd65a9c89599f7af944a66a 100755 (executable)
@@ -240,11 +240,6 @@ for model in [*pre_computed_hashes, *all_models]:
     if tokt == TOKENIZER_TYPE.SPM or tokt == TOKENIZER_TYPE.UGM:
         continue
 
-    # Skip if the tokenizer folder does not exist or there are other download issues previously
-    if not os.path.exists(f"models/tokenizers/{name}"):
-        logger.warning(f"Directory for tokenizer {name} not found. Skipping...")
-        continue
-
     # create the tokenizer
     if chkhsh is not None:
         # if the model has a pre-computed hash, use it
@@ -254,6 +249,12 @@ for model in [*pre_computed_hashes, *all_models]:
         chkhsh = existing_models[name]
     else:
         # otherwise, compute the hash of the tokenizer
+
+        # Skip if the tokenizer folder does not exist or there are other download issues previously
+        if not os.path.exists(f"models/tokenizers/{name}"):
+            logger.warning(f"Directory for tokenizer {name} not found. Skipping...")
+            continue
+
         try:
             logger.info(f"Loading tokenizer from {f'models/tokenizers/{name}'}...")
             if name == "t5":