marella / ctransformers

Python bindings for the Transformer models implemented in C/C++ using GGML library.
MIT License
1.76k stars 137 forks source link

Unclear error: GGML_ASSERT: D:\a\ctransformers\ctransformers\models\ggml/llama.cpp:453: data #189

Open deveolper opened 7 months ago

deveolper commented 7 months ago

GGML_ASSERT: D:\a\ctransformers\ctransformers\models\ggml/llama.cpp:453: data

I get this error sometimes when loading a model. At first, I thought it was a corrupted model, and I redownloaded it which fixed the issue. However, later, the issue reappeard, and the metadata of the file showed that it hasn't changed since I redownloaded it. After a lot of digging into the code of ctransformers, I concluded that it is probably a problem with not having enough memory, so I increased the swapfile and it resolved the issue completely.

Please do something to make this error more clear. Maybe throw a Python "MemoryError". That at least sends me in the right direction to finding a solution.

PS. I do understand that this error might be triggered in multiple ways, not just by a MemoryError. So, I suggest adding a line to the error that says something like "this could be a memory-error. Please make sure you have enough memory available."

jalajc commented 6 months ago

@deveolper struggling with the same.

deveolper commented 6 months ago

@jalajc, does increasing the size of the swapfile solve the issue for you too?

jalajc commented 6 months ago

@jalajc, does increasing the size of the swapfile solve the issue for you too?

Yes.

Apparently I was on wsl2 Ubuntu jammy and the default settings didn't allow much of Ram. But your comment thankfully hinted me to check memory inside, otherwise I was assuming I had enough memory.

Atleast the error could be more specific.