We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
llama_state_get_size
1 parent 60526e3 commit a65d613Copy full SHA for a65d613
src/llama-context.cpp
@@ -1704,10 +1704,12 @@ size_t llama_context::state_write_data(llama_io_write_i & io) {
1704
}
1705
1706
1707
- LLAMA_LOG_DEBUG("%s: - writing KV self\n", __func__);
1708
llama_kv_cache * kv_self = static_cast<llama_kv_cache *>(memory.get());
1709
-
1710
- kv_self->state_write(io);
+
+ if (kv_self != nullptr) {
+ LLAMA_LOG_DEBUG("%s: - writing KV self\n", __func__);
1711
+ kv_self->state_write(io);
1712
+ }
1713
1714
return io.n_bytes();
1715
0 commit comments