GithubHelp home page GithubHelp logo

Comments (9)

martindevans avatar martindevans commented on May 23, 2024

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.

BruceKristelijn avatar BruceKristelijn commented on May 23, 2024

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.

BruceKristelijn avatar BruceKristelijn commented on May 23, 2024

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.

martindevans avatar martindevans commented on May 23, 2024

Is this testing all being done on top of my PR (#64), with master or with some other version?

from llamasharp.

BruceKristelijn avatar BruceKristelijn commented on May 23, 2024

Not yet, this was my next course of action. Was hoping I understoot the behaviour correctly first.

from llamasharp.

martindevans avatar martindevans commented on May 23, 2024

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.

BruceKristelijn avatar BruceKristelijn commented on May 23, 2024

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.

martindevans avatar martindevans commented on May 23, 2024

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.

martindevans avatar martindevans commented on May 23, 2024

0.4.2 is out now. Does that resolve this issue?

from llamasharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.