GithubHelp home page GithubHelp logo

Comments (5)

martindevans avatar martindevans commented on June 21, 2024 1

It's just in the root LLama namespace (see here), but I don't think it's been released in a nuget package yet.

The examples in the docs seem to be correct for the currently released version: https://scisharp.github.io/LLamaSharp/0.4/Examples/LoadAndSaveState/

Alternatively you can pull master and use the new system. If you do I'd be very interested to hear any feedback you have about the new system.

from llamasharp.

martindevans avatar martindevans commented on June 21, 2024 1

"System.ArgumentException: '.NET number values such as positive and negative infinity cannot be written as valid JSON.' "

Can you find out which field is the invalid value? That probably indicates a bug somewhere else, putting a bad value into the state.

from llamasharp.

PsillyPseudonym avatar PsillyPseudonym commented on June 21, 2024 1

I just loaded an older version of my program that wasn't working but now both ChatSession.SaveSession and InteractiveExecutor.SaveState are working again. I don't know what's going on.
I wrote above that nothing's changing between it intermittently working but realised that I have been using different types of models so I tested a few and they all worked. Really bizarre! If it happens again, I'll try getting those details for you.

from llamasharp.

PsillyPseudonym avatar PsillyPseudonym commented on June 21, 2024

Thanks for your response. I'll try pulling master later and test out the new system. With the current release (0.4.2) for some reason, when using ChatSession.SaveState ChatSession.SaveSession or InteractiveExecutor.SaveState, there's sometimes an error writing the JSON file and I haven't been able to figure out what causes it as it sometimes works even though I haven't changed anything:

"System.ArgumentException: '.NET number values such as positive and negative infinity cannot be written as valid JSON.' "

I guess it doesn't really matter if it's changing for a future release. InteractiveExecutor.Model.SaveState seems to be working though but that doesn't save a JSON file, only a model file. Don't know if that's important or not.

from llamasharp.

PsillyPseudonym avatar PsillyPseudonym commented on June 21, 2024

So I've been able to consistently replicate the bug. It appears to be a problem with AntiPrompts.
The program generates the JSON error whenever you try to save the session when the antiprompt (in this case, "User:") is the last token of the initial setup prompt, i.e. : "You are an AI assistant. Answer any questions given. User:"

(This bug didn't always show up for me because I sometimes put my instructions/query directly in the initial prompt after "User:")

I can't see how it's trying to write the JSON file as that's all handled in the nuget package.

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.