Comments (9)
At the moment the model weights and the context are all bound together in one object. You need to save and restore "states" to have two contexts in one set of weights. This is due to how llama.cpp itself used to work.
They've since made a change which splits model weights and model contexts into two separate things, so you can make multiple contexts from one set of shared weights. My PR (#64) partially addresses this by adding in support for the new loading system. Future PRs will modify the higher level APIs to use this.
from llamasharp.
Thanks for the response. I am trying it right now but my responses seems to lose some context. I assumed that when a state is loaded / saved it retains the chat and prompt history, or am I mistaken?
from llamasharp.
I tried including the chat history after loading the session again aswell but this seemed to reset the "memory" of the previous conversation aswell,
from llamasharp.
Is this testing all being done on top of my PR (#64), with master
or with some other version?
from llamasharp.
Not yet, this was my next course of action. Was hoping I understoot the behaviour correctly first.
from llamasharp.
I'm not too sure, sorry. I've been contributing PRs on some of the lower level bits of the stack but not the "higher level "stuff yet. I do know there are a few layers, which should all save and reload state together (executor, context etc), so maybe try backtracing some of that to check it all looks reasonable.
from llamasharp.
Thanks, I just build your PR and it seems to work better without changing a lot of code which is great! Might be the wrong place to ask but I couldn't find it in sourcecode. Do you know if LLamaSharp adds things like 'Assistant:', and 'User:' to the chat?
from llamasharp.
As far as I know it does not, but that'd be in the higher level parts that I'm not too familiar with so I'm not too sure on that!
from llamasharp.
0.4.2 is out now. Does that resolve this issue?
from llamasharp.
Related Issues (20)
- Saving State after GetState HOT 1
- Wrong result when change to other model. HOT 3
- Using this repo in unity 3d. HOT 1
- issue with StreamingTokenDecoder? HOT 4
- System.Runtime.InteropServices.MarshalDirectiveException: 'Method's type signature is not PInvoke compatible.' HOT 17
- Use NerdBank.GitVersioning for versioning HOT 1
- Attempted to read or write protected memory with llama.dll from the llama.cpp project - b2072 release HOT 2
- Avoid declaring constructors with parameters if the properties of the type can be obtained from configuration settings. HOT 2
- llamasharp.backend.cpu is missing NuGet package README file
- RuntimeError: for .NET framework 4.7.2. HOT 8
- Anyone really success by following the steps in the Get Started? HOT 12
- NativeApi: `TryLoadLibrary()` can fail for some systems HOT 4
- LlamaSharp.Backend.MacMetal is broken HOT 6
- Getting exception: "llama_decode failed: 'NoKvSlot'" when LLM analyze text (news) HOT 6
- GitHub: link to documentation page HOT 1
- LLamaLogLevel: ensure numbering matches llama.cpp HOT 1
- Gemma Is Not Supported HOT 7
- Negative Prompt support - not found HOT 5
- ZLUDA Support HOT 1
- Possibly useful for documentation: Article by us on Medium about building a Console App with .Net 8.0 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 llamasharp.