Commit 2da217a1 authored by Your Name's avatar Your Name

Fix: Remove hash prefix from cached GGUF filenames properly

parent 34648b9b
...@@ -1424,9 +1424,9 @@ class VulkanBackend(ModelBackend): ...@@ -1424,9 +1424,9 @@ class VulkanBackend(ModelBackend):
# Also handle cached files with hash prefix: hash_modelname.gguf -> modelname # Also handle cached files with hash prefix: hash_modelname.gguf -> modelname
model_base = model_file.replace('.gguf', '') model_base = model_file.replace('.gguf', '')
# Remove hash prefix (40 hex chars followed by underscore) # Remove hash prefix (40 hex chars followed by underscore) - find last underscore if starts with hex
import re if len(model_base) > 40 and model_base[:40].isalnum():
model_base = re.sub(r'^[0-9a-f]{40}_', '', model_base) model_base = model_base[41:] # Skip hash + underscore
# Remove common quantization suffixes # Remove common quantization suffixes
for suffix in ['_q4_k_m', '_q4_k', '_q5_k', '_q5_k_m', '_q8_0', '_f16', '_q4_0', '_q3_k_m', '_q2_k']: for suffix in ['_q4_k_m', '_q4_k', '_q5_k', '_q5_k_m', '_q8_0', '_f16', '_q4_0', '_q3_k_m', '_q2_k']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment