Skip to content

Conversation

@Okabintaro
Copy link
Contributor

I fixed the issue by making the saved state a bytes object instead of the ctypes one which can't be pickled.
Not sure if this is ideal though, maybe the copy on loading from cache can be avoided.

Stumbled upon another bug in the disk cache which caused it to crash on pushing keys using the disk cache library.
When using cache.push(), an integer gets put into the cache as a key(see documentation) which then won't be comparable to the token sequence on subsequent cache fetches.
I commented that line out for now but there should be a better way to handle this.

I fixed the issue by making the saved state a bytes object instead of the ctypes one which can't be pickled.
xaptronic pushed a commit to xaptronic/llama-cpp-python that referenced this pull request Jun 13, 2023
* Major refactoring - introduce C-style API

* Clean up

* Add <cassert>

* Add <iterator>

* Add <algorithm> ....

* Fix timing reporting and accumulation

* Measure eval time only for single-token calls

* Change llama_tokenize return meaning
xaptronic pushed a commit to xaptronic/llama-cpp-python that referenced this pull request Jun 13, 2023
@gjmulder gjmulder changed the title fix: Make LLamaState pickable for disk cache fix: Make LLamaState pickleable for disk cache Jun 13, 2023
@gjmulder
Copy link
Contributor

Bump

@gjmulder gjmulder requested a review from abetlen June 23, 2023 09:45
@abetlen abetlen marked this pull request as ready for review June 26, 2023 12:46
@abetlen abetlen merged commit 628e3fb into abetlen:main Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants