You are not logged in.
When I call a .llamafile, which is marked executable with
chmod +x
and
chmod 777
the system should use sh to run it, but instead it tries to use wine. I tried to use mimeo to reconfigure the system to use sh, but it doesn't seem to take hold. I'm assuming this is because I'm running a command line program and not a desktop application? Regardless, how do I tell my computer to run llamafiles using sh?
Strangely, I don't have the same issue on my laptop, even though it has almost the same configuration.
Last edited by nameiwillforget (2024-03-13 16:30:10)
Offline
if you directly execute your .llamafile and it's actually sh compatible it should have the relevant Shebang telling the interpreter that should be used: https://en.wikipedia.org/wiki/Shebang_(Unix)
But FWIW since this also contains exe/windows stuff it's likely the bfmt integration interprets this for wine. see e.g. https://wiki.archlinux.org/title/Wine#R … e_bindings btu it'd wonder whether you can configure it to ignore .llamafile explicitly.
Last edited by V1del (2024-03-13 16:50:12)
Offline
But when I just execute the file, for instance by entering
llm.llamafile
in the same folder as the file, the system runs it with wine. Yet I know it can be run with sh because if I enter
sh llm.llamafile
it runs as it should. Furthermore, I've tried this with several files, and I've tried putting the files into ~/.local/bin, but the result is always the same.
Offline
yes, see my edit. Since a llamafile contains headers that make it look like a Windows exe (because that's what it is as well) chances are the wine binfmt integration shebang handler takes priority over whatever it'd normally try to use.
Offline
So, since I noticed that my wine install seemed to have a bug anyway, I tried what happens if I uninstalled it. Now, when I try to run a llamafile like a bash command, I get the following error:
-bash: /home/alex/.local/bin/wizardcoder-python-34b-v1.0.Q5_K_M.llamafile: cannot execute: required file not found
If I use sh llm.lamafile, it still works.
Last edited by nameiwillforget (2024-03-13 19:41:00)
Offline
Theres a workaround posted here: https://github.com/Mozilla-Ocho/llamafi … file#linux
sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf
sudo chmod +x /usr/bin/ape
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
Using root to add a random executable binary from the internet to /usr/bin seems like the wrong solution. Is this potentially an upstream binfmt issue or a distribution issue?
edit: actually looks like this software is packaged in aur and is by the same author as llamafile: https://aur.archlinux.org/packages/ape-bin
Last edited by adamc83 (2024-09-20 05:02:06)
Offline