Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ def chat_completion_handler(
return _convert_completion_to_chat_function(
tool_name, completion_or_chunks, stream
)
llama.reset()
llama._ctx.kv_cache_clear()
return _convert_completion_to_chat(completion_or_chunks, stream=stream)

return chat_completion_handler
Expand Down