cocktailpeanut / dalai

The simplest way to run LLaMA on your local machine
https://cocktailpeanut.github.io/dalai
13.09k stars 1.42k forks source link

(windows) Cmake error? And other errors #128

Open jay5656 opened 1 year ago

jay5656 commented 1 year ago

Steps: Install visual studio with python, node.js, and c++ development (directories changed from windows C drive to S drive with no windows) Install node.js from their site Already have python from the python site due to stable diffusion, might be the problem as 3.10.6 is what I have, while alpaca recommends 3.10

While the readme says only 7B is supported, alpaca.cpp has a magnet link for 13B so I tried that when installing, could also be the problem.

Here's what I get when trying to install to my S drive

C:\Users\jojo\dalai\venv\Scripts\cmake : The term 'C:\Users\jojo\dalai\venv\Scripts\cmake' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

And this is what I get when trying to ask anything

[2J [m [HWindows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6 ]0;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe [?25h [25l [6;1H [?25hPS C:\Users\jojo\dalai\alpaca> [?25l PS C:\Users\jojo\dalai\alpaca> [93mC:\Users\jojo\dalai\alpaca\build\Release\llama [m [90m--seed [m -1 [90m--threads [m [97m4 [m [90m--n_predict [m [97m200 [m [90m--model [m models/13B/ggml-model-q4_0.bin [90m--top_k [m [97m40 [m [90m--top_p [m [97m0.9 [m [90m--temp [m [97m0.1 [m [90m--repeat_la st_n [m [97m64 [m [90m--repeat_penalty [m [97m1.3 [m [90m-p [m [36m"who was the first president" [m [K [?25h [91mC:\Users\jojo\dalai\alpaca\build\Release\llama : The term 'C:\Users\jojo\dalai\alpaca\build\Release\llama' is not recognized as the name of a cmdlet, function, script file, or operable program. [m [91m Check the spelling of the name, or if a path was included, verify that the path is correct and try again. [m [12X [91m At line:1 char:1 [m [101X [91m

ghost commented 1 year ago

I'm not using Powershell as the quickstart guide said not to, but I am having same Cmake errors too on cmd.

jay5656 commented 1 year ago

I'm not using Powershell as the quickstart guide said not to, but I am having same Cmake errors too on cmd.

Me too, I'm worried it's because I'm not installing on the C drive with windows, I literally only have 5GBs left so I can't.

ghost commented 1 year ago

I'm not using Powershell as the quickstart guide said not to, but I am having same Cmake errors too on cmd.

Me too, I'm worried it's because I'm not installing on the C drive with windows, I literally only have 5GBs left so I can't.

I installed mine on C-drive. It's not that.. I even added Cmake to the path and it still errors out.

AdamJWood commented 1 year ago

Same issue here as well on Windows 11. Uninstalled and reinstalled everything with same results. Frustrating.

jay5656 commented 1 year ago

I'm not using Powershell as the quickstart guide said not to, but I am having same Cmake errors too on cmd.

Me too, I'm worried it's because I'm not installing on the C drive with windows, I literally only have 5GBs left so I can't.

I installed mine on C-drive. It's not that.. I even added Cmake to the path and it still errors out.

Do you also have the right python version? Or are you running 3.10.6 like me

Haniamin90 commented 1 year ago

same here.. the issue is dalai dir does not have "venv"

jay5656 commented 1 year ago

same here.. the issue is dalai dir does not have "venv"

Glad to see so many with this issue, I was worried it was something simple that I did wrong

Haniamin90 commented 1 year ago

same here.. the issue is dalai dir does not have "venv"

Glad to see so many with this issue, I was worried it was something simple that I did wrong

i was about to re-install the whole windows lol

pucbaldwin commented 1 year ago

Same issue

labs-mirkoisaia commented 1 year ago

manually installing venv, and cmake, seems to have fixed the problem

step to fix:

python3 -m venv venv

.\venv\script\pip3.exe install cmake

npx dalai alpaca install 7B

still downloading, tho

saintkamus commented 1 year ago

manually installing venv, and cmake, seems to have fixed the problem

step to fix:

python3 -m venv venv

.\venv\script\pip3.exe install cmake

npx dalai alpaca install 7B

still downloading, tho

Don't work for me, where do you even run that? I tried from cmd prompt, and it doesn't work.

jay5656 commented 1 year ago

How would I uninstall? Considering I tried to use the 13B. Would I just go to where I used "NPX dalai alpaca 13B" and delete all the files there? Or is there more to it?

Also ill try it out

jay5656 commented 1 year ago

manually installing venv, and cmake, seems to have fixed the problem

step to fix:

python3 -m venv venv

.\venv\script\pip3.exe install cmake

npx dalai alpaca install 7B

still downloading, tho

i had to use this instead as just copying that would tell me python wasnt installed py -m venv venv then i went to that folder which is under users/(your user)/venv/scripts/

then you type cmd at the top where that path is, which puts you in that directory, and type pip3.exe install cmake

what you do then, is go back to C;/user/Youruser and take that venv folder and COPY (DO NOT DELETE IT) it into the dalai folder thats also under C:/user/Youruser

Delete the alpaca / llama folder Run the installation again and it won't have a Cmake error

labs-mirkoisaia commented 1 year ago

sorry, i wasn't very explicative.

i run all in the same directory (for me is automatically in user\myuser\dalai) open it in cmd

C:\>cd C:\Users\yourUserName

C:\Users\yourUserName>python3 -m venv venv

C:\Users\yourUserName>.\venv\Script\pip3.exe install cmake

C:\Users\yourUserName | but really from anywhere at this point> npx dalai alpaca install 7B
zdrummon commented 1 year ago

Hmm, when I typed .\venv\Script\pip3.exe install cmake, it said "the system cannot find the path specified"

What exactly is this step supposed to do? Yes I did the step prior, as well.

jay5656 commented 1 year ago

Hmm, when I typed .\venv\Script\pip3.exe install cmake, it said "the system cannot find the path specified"

What exactly is this step supposed to do? Yes I did the step prior, as well.

check out my comment above, i fixed it by doing what i said there

sreinwald commented 1 year ago

Here's what worked for me:

Move to the dalai folder in your User folder, in my case c:\Users\Stephan\dalai. Create it if it doesn't exist yet.

py -m venv venv
.\venv\Scripts\activate
pip install install cmake
npx dalai alpaca install 7B

If you have multiple installations of python, in my case 3.10 and 3.11, change the first command to py -3.10 -m venv venv to ensure dalai uses 3.10.

zdrummon commented 1 year ago

Hmm, when I typed .\venv\Script\pip3.exe install cmake, it said "the system cannot find the path specified" What exactly is this step supposed to do? Yes I did the step prior, as well.

check out my comment above, i fixed it by doing what i said there

oh man that does not make things better, that causes the return of older errors that I had already solved. I'm getting like a dozen errors here so its hard to work through them all and tell which is just a result of which

jay5656 commented 1 year ago

While i have found my solution and now have a working dalai, im going to leave this open because i dont think it was intended to be this way, so hopefully they fix this.

on a side note, im having this problem now. dalai

i assume its a ram issue? but my 16GB only went from 5.2GB idle, to 9.3GB when using dalai, so i dont understand the problem.

jay5656 commented 1 year ago

Hmm, when I typed .\venv\Script\pip3.exe install cmake, it said "the system cannot find the path specified" What exactly is this step supposed to do? Yes I did the step prior, as well.

check out my comment above, i fixed it by doing what i said there

oh man that does not make things better, that causes the return of older errors that I had already solved. I'm getting like a dozen errors here so its hard to work through them all and tell which is just a result of which

sorry about that bro! make sure you try sreinwald's comment

NicolasDorier commented 1 year ago

@jay5656, your fix didn't work for me. What worked is to rename C:\Users\xxx\dalai\alpaca\build\Release\main.exe to C:\Users\xxx\dalai\alpaca\build\Release\llama.exe

jay5656 commented 1 year ago

@jay5656, your fix didn't work for me. What worked is to rename C:\Users\xxx\dalai\alpaca\build\Release\main.exe to C:\Users\xxx\dalai\alpaca\build\Release\llama.exe

its so weird how it only worked for me so far...

NicolasDorier commented 1 year ago

Maybe some recent changes?

On https://github.com/ggerganov/llama.cpp , they use main.exe, not llama.exe. And I couldn't find any reference to llama.exe in this repository.

luis-herasme commented 1 year ago

This is what worked for me: First, you have to install cmake, then you have to use the partial solution of @labs-mirkoisaia:

C:\>cd C:\Users\[YourUserName]\dalai>
C:\Users\[YourUserName]\dalai>python -m venv venv
C:\Users\[YourUserName]\dalai>cd \venv\Script
C:\Users\[YourUserName]\dalai\venv\>pip3.exe install cmake

Then I had to install everything again with:

C:\>cd C:\Users\[YourUserName]\>npx dalai alpaca install 7B

Finally, I had to use the solution of @NicolasDorier. Rename the file: C:\Users\[YourUserName]\dalai\alpaca\build\Release\main.exe To C:\Users\[YourUserName]\dalai\alpaca\build\Release\llama.exe

luis-herasme commented 1 year ago

This is what worked for me: First, you have to install cmake, then you have to use the partial solution of @labs-mirkoisaia:

C:\>cd C:\Users\[YourUserName]\dalai>
C:\Users\[YourUserName]\dalai>python -m venv venv
C:\Users\[YourUserName]\dalai>cd \venv\Script
C:\Users\[YourUserName]\dalai\venv\>pip3.exe install cmake

Then I had to install everything again with:

C:\>cd C:\Users\[YourUserName]\>npx dalai alpaca install 7B

Finally, I had to use the solution of @NicolasDorier. Rename the file: C:\Users\[YourUserName]\dalai\alpaca\build\Release\main.exe To C:\Users\[YourUserName]\dalai\alpaca\build\Release\llama.exe

Now, if you have the latest version, you should not have to rename main.exe to llama.exe: https://github.com/cocktailpeanut/dalai/commit/220d5514cb588660274124d1592873ba12ce0af9

zdrummon commented 1 year ago

I've tried nearly everything in here to get it to work on my D:\ drive.

Has anyone had any luck with actually successfully installing it anywhere but C:\?

labs-mirkoisaia commented 1 year ago

Sorry it was 3am for me, and wans't really lucid at that point.

Previous of the installation i had installed Visual studio Desktop Env with C++, as node and python were already present in my computer, npx dalai installs stuff under Users\Name\dalai folder, as the npx command went rogue for not finding stuff in the directory, i provided in my build the missing components: venv and cmake, as my previous steps.

And that kinda worked, don't know if everything, but alpaca7b started.

jay5656 commented 1 year ago

I've tried nearly everything in here to get it to work on my D:\ drive.

Has anyone had any luck with actually successfully installing it anywhere but C:?

I was able to with my method, make sure to check other people's method as well.

nigelp commented 1 year ago

I've done all of the above fixes. and now when I do the prompt I get:

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe[?25h[?25hPS C:\Users\Adam\dalai\alpaca> [?25lC[?25h[?25l PS C:\Users\Adam\dalai\alpaca> C:\Users\Adam\dalai\alpaca\build\Release\main --seed -1 --threads 4 --n_predict 200 --model models/7B/ggml-model-q4_0.bin --top_k 40 --top_p 0.9 --temp 0.1 --repeat_last

_n 64 --repeat_penalty 1.3 -p "where is rome"

[?25hmain: seed = 1679321497

llama_model_load: loading model from 'models/7B/ggml-model-q4_0.bin' - please wait ...

llama_model_load: ggml ctx size = 6065.34 MB

llama_model_load: memory_size = 2048.00 MB, n_mem = 65536

llama_model_load: loading model part 1/1 from 'models/7B/ggml-model-q4_0.bin'

llama_model_load: .................................... done

llama_model_load: model size = 4017.27 MB / num tensors = 291



system_info: n_threads = 4 / 4 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 0 | NEON = 0 | ARM_FMA = 0 | F16C = 0 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 0 | VSX = 0 |



main: prompt: 'where is rome'

main: number of tokens in prompt = 5

 1 -> ''

3062 -> 'where'

338 -> ' is'

29871 -> ' '

4871 -> 'rome'



sampling parameters: temp = 0.100000, top_k = 40, top_p = 0.900000, repeat_last_n = 64, repeat_penalty = 1.300000[?25hPS C:\Users\Adam\dalai\alpaca> e[?25lexit

[?25h

ghost commented 1 year ago

Yeah no.. None of the venv things mentioned here worked for me. I still get the cmake error

NicolasDorier commented 1 year ago

Now, if you have the latest version, you should not have to rename main.exe to llama.exe: https://github.com/cocktailpeanut/dalai/commit/220d5514cb588660274124d1592873ba12ce0af9

Indeed, I just tried the new npx dalai@0.2.50 serve, and it seems to be using main.exe correctly now.

Jordain commented 1 year ago

I get the cmake error still after trying all the venv solutions

starmix777 commented 1 year ago

for those who are still having issues with cmake error, here is a solution that worked for me : install visual studio community 2019 and not the 2022 version (it isn't a problem to have both apparently).

alexwyattdev commented 1 year ago

for those who are still having issues with cmake error, here is a solution that worked for me : install visual studio community 2019 and not the 2022 version (it isn't a problem to have both apparently).

Sadly even this did not work for me

ghost commented 1 year ago

I solved this issue for myself differently. It's bit more technical but using oobabooga instead of dalai as it runs without any issues and there is models on HugginFace of Alpaca that run on it. There is actually loads of models that work on oobabooga

nigelp commented 1 year ago

I solved this issue for myself differently. It's bit more technical but using oobabooga instead of dalai as it runs without any issues and there is models on HugginFace of Alpaca that run on it. There is actually loads of models that work on oobabooga

Totally agree.