GithubHelp home page GithubHelp logo

Comments (3)

AsakusaRinne avatar AsakusaRinne commented on September 26, 2024 1

It would be great if you'd like to make itπŸ˜€

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on September 26, 2024

Hi, I think it's a correct way with a rough look at your code.

Do you think it's worth to implement it into some interface at ChatSession level? (similar to how it's done at Executor level)

From my perspective I'd like to see such an API in ChatSession. As you can see, some extra process of the output is performed when switching context, which could be wrapped in an API.

Also one thing I struggled to find is something like AddMessage but in non-lazy way with context.Decode happening at the same time, to precompute KV cache before generating the first message.

It's a good idea for performance improvement. More generally The generation and prefill could be separate parts and exposed to users in a certain way. Currently I think there's also a tricky way to do so. When you want to prefill it without generation, you just need to set the last several words of your prompt as antiprompt (but be sure it's alone).

FYI @martindevans

from llamasharp.

eublefar avatar eublefar commented on September 26, 2024

Great, thanks for taking time to look at the code.

I think I could make a PR for these changes if you want.

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.