emacs-copilot
emacs-copilot copied to clipboard
Problem with accessing the cache, llamafile core-dumps
I'm using the phi-2 llamafile on Linux and it core dumps because it is unable to open the cache file. I noticed that calling copilot-complete from emacs would simply terminate.
I ran the command that is logged to stderr directly in the shell:
$ /home/krm/bin/phi-2.Q5_K_M.llamafile -m phi-2.Q5_K_M.gguf --prompt-cache /home/krm/Desktop/prime_utilities.py.cache --prompt-cache-all --silent-prompt --temp 0 -c 1024 -ngl 35 -r '```' -r "\n}" -f /home/krm/Desktop/prime_utilities.py.prompt
I got this error:
libc++abi: terminating due to uncaught exception of type std::runtime_error: failed to open /home/krm/Desktop/prime_utilities.py.cache: Bad file number
error: Uncaught SIGABRT (SI_TKILL) at 0x3e8000062b1 on vger-mac pid 25265 tid 25265
/home/krm/bin/phi-2.Q5_K_M.llamafile
Bad file number
Linux Cosmopolitan 3.3.3 MODE=x86_64; #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 vger-mac 5.4.0-204-generic
Removing the cache file option worked.
/home/krm/bin/phi-2.Q5_K_M.llamafile -m phi-2.Q5_K_M.gguf --prompt-cache-all --silent-prompt --temp 0 -c 1024 -ngl 35 -r '```' -r "\n}" -f /home/krm/Desktop/prime_utilities.py.prompt
It now works in emacs without the caching options.
This is all after I made the llamafile a native executable as referenced here: https://github.com/jart/emacs-copilot/issues/2#issuecomment-1872986072, because otherwise I'd get the forking error.