Skip to content

How to convert old ALPACA q4_0 model into ggjt format? #701

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

Closed
multimediaconverter opened this issue Apr 2, 2023 · 4 comments
Closed

How to convert old ALPACA q4_0 model into ggjt format? #701

multimediaconverter opened this issue Apr 2, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists script Script related

Comments

@multimediaconverter
Copy link

multimediaconverter commented Apr 2, 2023

I'm trying to use a python script, but it returns the following error:

d:\ALPACA2>python migrate-ggml-2023-03-30-pr613.py ggml-alpaca-7b-q4.bin ggml-alpaca-7b-q4-ggjt.bin
Traceback (most recent call last):
File "d:\ALPACA2\migrate-ggml-2023-03-30-pr613.py", line 313, in
main()
File "d:\ALPACA2\migrate-ggml-2023-03-30-pr613.py", line 274, in main
tokens = read_tokens(fin, hparams)
File "d:\ALPACA2\migrate-ggml-2023-03-30-pr613.py", line 135, in read_tokens
word = fin.read(length)
ValueError: read length must be non-negative or -1

@thefcraft
Copy link

Same error for gpt4all model

@akx
Copy link
Contributor

akx commented Apr 3, 2023

Convert it with convert-unversioned-ggml-to-ggml.py first.

@multimediaconverter
Copy link
Author

multimediaconverter commented Apr 4, 2023

I converted alpaca model into this new format successfully.

  1. convert-unversioned-ggml-to-ggml.py with tokenizer.model file and migrate-ggml-2023-03-30-pr613.py.

  2. VS2017 Express x64 with AVX2 to compile examples/main/main.cpp on Windows.

And what can I say: finally, it works! llama.cpp generates text ~1.5-2 times faster than alpaca.cpp

@sw
Copy link
Contributor

sw commented Apr 4, 2023

Original issue resolved -> Closing this, duplicates #704

@sw sw closed this as completed Apr 4, 2023
@sw sw added duplicate This issue or pull request already exists script Script related labels Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists script Script related
Projects
None yet
Development

No branches or pull requests

4 participants