abetlen / abetlen/llama-cpp-python

Improve error messages

未關閉
#2,145 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
10.6k
分支
1.4k
PR 合併指標
PR 指標待擷取

描述

Repro steps:

1. Go to https://huggingface.co/HauhauCS/Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive
2. Click "use this model" -> colab
3. Run code on colab

Generated code is:

```
from llama_cpp import Llama

llm = Llama.from_pretrained(
repo_id="HauhauCS/Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive",
filename="Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive-BF16.gguf",
)
```

which fails with:

```
ValueError Traceback (most recent call last)

[/tmp/ipykernel_1917/696730726.py](https://localhost:8080/#) in ()
3 from llama_cpp import Llama
4
----> 5 llm = Llama.from_pretrained(
6 repo_id="HauhauCS/Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive",
7 filename="Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive-BF16.gguf",

2 frames

[/usr/local/lib/python3.12/dist-packages/llama_cpp/_internals.py](https://localhost:8080/#) in __init__(self, path_model, params, verbose)
56
57 if model is None:
---> 58 raise ValueError(f"Failed to load model from file: {path_model}")
59
60 vocab = llama_cpp.llama_model_get_vocab(model)

ValueError: Failed to load model from file: /root/.cache/huggingface/hub/models--HauhauCS--Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive/snapshots/53367faad177ee6a23601983cdac4308b51393df/./Qwen3.5-35B-A3B-Uncensored-HauhauCS-Aggressive-BF16.gguf
```

This error message is not actionable as it doesn't say why it failed to load so the user can't do much about it.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。