Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama.exe doesn't handle relative file paths in Windows correctly #46

Closed
jjyuhub opened this issue Mar 12, 2023 · 10 comments
Closed

llama.exe doesn't handle relative file paths in Windows correctly #46

jjyuhub opened this issue Mar 12, 2023 · 10 comments
Labels
bug Something isn't working model Model specific windows Issues specific to Windows

Comments

@jjyuhub
Copy link

jjyuhub commented Mar 12, 2023

Please include the ggml-model-q4_0.bin model to actually run the code:

% make -j && ./main -m ./models/7B/ggml-model-q4_0.bin -p "Building a website can be done in 10 simple steps:" -t 8 -n 512
I llama.cpp build info: 
I UNAME_S:  Darwin
I UNAME_P:  arm
I UNAME_M:  arm64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -DGGML_USE_ACCELERATE
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread
I LDFLAGS:   -framework Accelerate
I CC:       Apple clang version 14.0.0 (clang-1400.0.29.202)
I CXX:      Apple clang version 14.0.0 (clang-1400.0.29.202)

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -DGGML_USE_ACCELERATE   -c ggml.c -o ggml.o
c++ -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread -c utils.cpp -o utils.o
c++ -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread main.cpp ggml.o utils.o -o main  -framework Accelerate
c++ -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread quantize.cpp ggml.o utils.o -o quantize  -framework Accelerate
./main -h
usage: ./main [options]

options:
  -h, --help            show this help message and exit
  -s SEED, --seed SEED  RNG seed (default: -1)
  -t N, --threads N     number of threads to use during computation (default: 4)
  -p PROMPT, --prompt PROMPT
                        prompt to start generation with (default: random)
  -n N, --n_predict N   number of tokens to predict (default: 128)
  --top_k N             top-k sampling (default: 40)
  --top_p N             top-p sampling (default: 0.9)
  --repeat_last_n N     last n tokens to consider for penalize (default: 64)
  --repeat_penalty N    penalize repeat sequence of tokens (default: 1.3)
  --temp N              temperature (default: 0.8)
  -b N, --batch_size N  batch size for prompt processing (default: 8)
  -m FNAME, --model FNAME
                        model path (default: models/llama-7B/ggml-model.bin)

main: seed = 1678619388
llama_model_load: loading model from './models/7B/ggml-model-q4_0.bin' - please wait ...
llama_model_load: failed to open './models/7B/ggml-model-q4_0.bin'
main: failed to load model from './models/7B/ggml-model-q4_0.bin'

My pre-signed URL to download the model weights was broken.

@ggerganov ggerganov added the wontfix This will not be worked on label Mar 13, 2023
@1octopus1
Copy link

Windows help me please
image

@gjmulder
Copy link
Collaborator

DId you follow the instructions in the README.md to download, convert and quantize the model? The model is not included in the repo.

@1octopus1
Copy link

DId you follow the instructions in the README.md to download, convert and quantize the model? The model is not included in the repo.

I tried everything .. I did not see a separate instruction for Windows (via CMake) =(

@gjmulder
Copy link
Collaborator

It is telling you it find the model in ./models/7B. Is the ggml-model-q4_0.bin file in that directory?

@G2G2G2G
Copy link

G2G2G2G commented Mar 15, 2023

I don't use powershell, and I don't know what ./Release/llama.exe is yellow (I assume that means it exists?)
but he is using forward slashes, and windows doesn't use those.. so idk if PS has some fancy shit to use the correct slashes or not
also does cmake create a Release file just for the .exe or are the models in there too?
anyway I am gonna assume that folder doesn't even exist because he's using the wrong slashes.

@gjmulder gjmulder added the model Model specific label Mar 15, 2023
@sebgod
Copy link

sebgod commented Mar 19, 2023

Well powershell supports forward slashes just fine, but in windows the path argument to llama.exe is passed verbatim, i.e. its up to llama.exe to handle parsing the relative file path correctly.

@gjmulder gjmulder added bug Something isn't working and removed wontfix This will not be worked on labels Mar 19, 2023
@gjmulder gjmulder changed the title main: failed to load model from './models/7B/ggml-model-q4_0.bin' llama.exe doesn't handle relative file paths in Windows properly Mar 19, 2023
@gjmulder gjmulder reopened this Mar 19, 2023
@gjmulder
Copy link
Collaborator

Reopened and corrected the issue title.

@gjmulder gjmulder changed the title llama.exe doesn't handle relative file paths in Windows properly llama.exe doesn't handle relative file paths in Windows correctly Mar 19, 2023
@VTSTech
Copy link

VTSTech commented Mar 19, 2023

Not sure if related. But the ggml-model-q4_0.bin I am getting is only 296kb

There is no error.

C:\llama\models\7B>quantize ggml-model-f16.bin ggml-model-q4_0.bin 2
llama_model_quantize: loading model from 'ggml-model-f16.bin'
llama_model_quantize: n_vocab = 32000
llama_model_quantize: n_ctx   = 512
llama_model_quantize: n_embd  = 4096
llama_model_quantize: n_mult  = 256
llama_model_quantize: n_head  = 32
llama_model_quantize: n_layer = 32
llama_model_quantize: f16     = 1
                           tok_embeddings.weight - [ 4096, 32000], type =    f16
C:\llama\models\7B>

@zhouhh2017
Copy link

You should check your model file, it's too small. I get this error because i wrong model_name spelling...

@ggml-org ggml-org deleted a comment from G2G2G2G Mar 23, 2023
@prusnak prusnak added the windows Issues specific to Windows label Apr 1, 2023
@prusnak
Copy link
Collaborator

prusnak commented Apr 16, 2023

Check the downloaded files via checksums in SHA256 file.
Please reopen if the issue still persists.

@prusnak prusnak closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2023
Deadsg pushed a commit to Deadsg/llama.cpp that referenced this issue Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working model Model specific windows Issues specific to Windows
Projects
None yet
Development

No branches or pull requests

9 participants