Comments (5)
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.
"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.
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.
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.
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)
- model bin file? HOT 3
- Running a simple example and I get : System.EntryPointNotFoundException Unable to find an entry point named 'llama_init_backend' in DLL 'libllama'. HOT 1
- a problem of Chinese coding HOT 19
- Add support for GGUF format.
- GitHub Action Compiling Dependencies HOT 11
- Feature Request: Support for Loading Models Spanning Multiple Files HOT 1
- gguf implementation from llama.cpp broke lib? HOT 2
- error loading model: unknown (magic, version) combination: 46554747, 00000002; is this really a GGML file? HOT 3
- Embedding recommended model HOT 5
- llama_state HOT 2
- Flash Attention 2 HOT 2
- hardcoded path in dll? User:LLAMA_ASSERT: E:\s\repos\llama.cpp\llama.cpp:1343: !!kv_self.ctx HOT 4
- Incorrect mirostat sampling
- Run from storage instead of memory HOT 1
- Error with .SaveState() HOT 6
- 0.4.2-preview issue: Interactive mode stops responding after the first request HOT 7
- LlamaEmbedder How to use HOT 7
- Out of GPU memory when creating multiple sessions HOT 3
- Will it be possible to load 70b models soon? HOT 7
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.