You are not logged in.

#1 2024-03-13 16:23:53

nameiwillforget
Member
Registered: 2019-08-10
Posts: 27

Llamafiles are run with wine instead of sh

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

#2 2024-03-13 16:44:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,804

Re: Llamafiles are run with wine instead of sh

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

#3 2024-03-13 16:53:53

nameiwillforget
Member
Registered: 2019-08-10
Posts: 27

Re: Llamafiles are run with wine instead of sh

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

#4 2024-03-13 16:56:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,804

Re: Llamafiles are run with wine instead of sh

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

#5 2024-03-13 19:38:29

nameiwillforget
Member
Registered: 2019-08-10
Posts: 27

Re: Llamafiles are run with wine instead of sh

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

Board footer

Powered by FluxBB