GithubHelp home page GithubHelp logo

Error with .SaveState() about llamasharp HOT 6 CLOSED

scisharp avatar scisharp commented on May 27, 2024
Error with .SaveState()

from llamasharp.

Comments (6)

mphacker avatar mphacker commented on May 27, 2024 1

I should mention that I am saving state right after creating a new executor so I have a "clean state" that I can reload later.

from llamasharp.

mphacker avatar mphacker commented on May 27, 2024 1

Works great! Thanks

from llamasharp.

martindevans avatar martindevans commented on May 27, 2024

Do you have a stacktrace from the error, to help track down exactly where it's coming from?

from llamasharp.

mphacker avatar mphacker commented on May 27, 2024

System.ArgumentException
HResult=0x80070057
Message=.NET number values such as positive and negative infinity cannot be written as valid JSON. To make it work when using 'JsonSerializer', consider specifying 'JsonNumberHandling.AllowNamedFloatingPointLiterals' (see https://docs.microsoft.com/dotnet/api/system.text.json.serialization.jsonnumberhandling).
Source=System.Text.Json
StackTrace:
at System.Text.Json.ThrowHelper.ThrowArgumentException_ValueNotSupported()
at System.Text.Json.Utf8JsonWriter.WriteNumberValue(Single value)
at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteCore[TValue](Utf8JsonWriter writer, TValue& value, JsonTypeInfo jsonTypeInfo, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteStream[TValue](Stream utf8Json, TValue& value, JsonTypeInfo jsonTypeInfo)
at System.Text.Json.JsonSerializer.Serialize[TValue](Stream utf8Json, TValue value, JsonSerializerOptions options)
at LLama.InteractiveExecutor.SaveState(String filename)
at ArchobotLLMServer.LLMServerAzureHybrid.d__31.MoveNext() in C:\Users\Owner\source\repos\mphacker\Archobotcore\ArchobotLLMServer\LLMServerHybrid.cs:line 93

from llamasharp.

martindevans avatar martindevans commented on May 27, 2024

I tracked down the issue to the mirostat_mu value. It's initially a NaN value to indicate a "not initialised yet" state and it gets set to a valid value the first time the model is evaluated. JSON serialization doesn't like NaN, so you get the error above.

Could you try out #88 to see if it fixes the issue for you? I've changed it to use a nullable float instead of a NaN value.

from llamasharp.

martindevans avatar martindevans commented on May 27, 2024

I've merged #88, so this should be fixed in the master branch now. If you can confirm it works for you I'll close the 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.