Comments (7)
Relevant code:
gpt4all/gpt4all-bindings/python/gpt4all/gpt4all.py
Lines 534 to 603 in 2025d2d
My best guess is that self.model.prompt_model_streaming
has its own internal state, which is why my attempts to manipulate the state in the outer layer are having no effect.
from gpt4all.
Maybe the previous tokens
are accumulated in this low-level tokens
C array, and that's the thing that isn't updated if you add stuff to _history
?
gpt4all/gpt4all-bindings/python/gpt4all/_pyllmodel.py
Lines 53 to 70 in 2025d2d
from gpt4all.
I asked for sothing similar today #2358
I tried to clear() current_chat_session for a new chat without leaving the context manager but that is also being ignored.
My simple GUI: https://github.com/woheller69/gpt4all-TK-CHAT
from gpt4all.
Aha: spotted this which happens only if self._history is None
:
That must be the mechanism that resets the internal token state.
from gpt4all.
More details on why I need this here:
My LLM tool works by logging messages and responses to a SQLite database, so you can do things like this:
llm "three names for a pet pelican"
# Outputs three names
llm -c "2 more" # -c means continue previous thread
# Outputs two more names
In order to get GPT4All working correctly as a plugin for my tool I need the ability to instantiate a new model and then start a chat session with the previous context populated from my persisted SQLite version - but I can't figure out a way to do that.
from gpt4all.
You might use llama-cpp-agent (https://github.com/Maximilian-Winter/llama-cpp-agent) and llama-cpp-python instead of gpt4all.
I am also experimenting with it: https://github.com/woheller69/LLAMA_TK_CHAT/blob/main/LLAMA_TK_GUI.py
There you can do things like: self.llama_cpp_agent.chat_history.get_message_store().add_assistant_message(...)
from gpt4all.
The way we accomplished support for initial chat session messages in the node bindings is using fake_reply . But I think its not exposed/documented as a user facing parameter in the py bindings. It looks intentional, but idk about the exact reasoning. May wanna expose it, or add some other way to allow for that "conversation restore" functionality that encapsulates fake_reply
. I believe it was initially added to allow for similar functionality in gpt4all-chat.
There might also be an alternative way to hack around it using the prompt template parameter + special=true and sending in the whole turns "pre-templated", including assistant response with n_predict=0.
from gpt4all.
Related Issues (20)
- Some questions about java calling gpt4all HOT 2
- python binding does not use explicitly requested NVIDIA GPU
- Cannot move window to see which models to choose to install HOT 3
- Update 2.8.0 error HOT 3
- Crash on long prompts (CPU) v2.8.0 HOT 3
- [Feature] Add support for local Nomic Text Embed models compatible models for local docs HOT 2
- Gibberish Response when using GPU (Quadro K6000) HOT 1
- How to mimic the GPT4ALL GUI output using Python library gpt4all() and embed4all() HOT 2
- Gpt4all shows only a gray screen HOT 1
- [Feature] Use CUDA device as default HOT 1
- [Feature] Button to save chat individually manually
- Download of models stuck HOT 1
- Unable to set the max context limit HOT 2
- dolphin-2.9.2-qwen2-72b-gguf, Cannot run, cannot use, error HOT 1
- Screen Turns Black Intermittently When Opening GPT4all on Desktop HOT 1
- [Feature] flathub verified HOT 1
- Crashes when indexing RAG HOT 2
- GPT4All version inconsistency in winget upgrade on Windows HOT 8
- [Feature] Support for Linux ARM64 HOT 1
- [Feature] Custom stopping word list HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpt4all.