macoron / gpt4all.unity Goto Github PK
View Code? Open in Web Editor NEWBindings of gpt4all language models for Unity3d running on your local machine
License: MIT License
Bindings of gpt4all language models for Unity3d running on your local machine
License: MIT License
Hi ! Sorry to bother you but i am a very beginner in unity ! ^^ I need your help about that error and GPU use in unity :
ExecutionEngineException: String conversion error: Partial byte sequence encountered in the input.
(wrapper native-to-managed) Gpt4All.LlmWrapper.ResponseCallbackStatic(int,intptr)
Gpt4All.LlmWrapper.Prompt (System.String promptText, Gpt4All.LlmPromptContext context) (at Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:85)
Gpt4All.LlmWrapper+<>c__DisplayClass17_0.b__0 () (at Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:99)
System.Threading.Tasks.Task`1[TResult].InnerInvoke () (at :0)
System.Threading.Tasks.Task.Execute () (at :0)
--- End of stack trace from previous location where exception was thrown ---
Gpt4All.LlmWrapper.PromptAsync (System.String promptText, Gpt4All.LlmPromptContext context) (at Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:100)
Gpt4All.LlmManager.Prompt (System.String rawPrompt) (at Packages/com.gpt4all.unity/Scripts/LlmManager.cs:133)
Gpt4All.Samples.ChatSample.SendToChat (System.String prompt) (at Assets/Samples/1 - Chat/ChatSample.cs:43)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at :0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)
Do you have an idea of what it is ?
Did I download and install things correctly ?
And finally, do you know how to use GPU instead of CPU ?
Thanks in advance Macoron !
I encountered an issue when attempting to add a repository as a Unity Package to my existing project using the Git URL in Unity Package Manager. The error logs indicate that two DLL files, namely libllama.dll and libllmodel.dll, along with their dependencies, could not be loaded.
Steps to Reproduce:
1. Open Unity project.
2. Go to Unity Package Manager.
3. Click on the "+" button and select "Add package from git URL".
4. Enter the Git URL for the repository and proceed.
5. Wait for the package to be imported.
6. Observe the error message related to the DLL files and their dependencies not being loaded.
Error Logs:
../Library/PackageCache/com.gpt4all.unity@548076b369/Plugins/Windows/libllama.dll' because one or more of its dependencies could not be loaded.
../Library/PackageCache/com.gpt4all.unity@548076b369/Plugins/Windows/libllmodel.dll' because one or more of its dependencies could not be loaded.
Unity3D 2022.2.2f1
Win11
Thanks.
Can I create multiple instances of LLM Manager to have several "chats" with distinct context and history existing simultaneously?
Could you fix this since the old dll in the commit that did work are now severely out dated?
// Singleton instance
public static LlmManager Instance { get; private set; }
if (Instance == null)
{
Instance = this;
}
else
{
DestroyImmediate(this);
}
public string GetModelPath(string modelPath)
{
return Path.Combine(Application.streamingAssetsPath, modelPath);
}
// correcting faulty path by getting it from one central In-App location
var path = GetModelPath(modelPath);
// correcting faulty path by getting it from one central In-App location
var path = LlmManager.Instance.GetModelPath(modelPath);
I've been reported that project may crash during opening in Unity. Still researching why it could be the case, but if you are experiencing something similar, try to checkout this commit:
Please report in this issue if you have this problem and if checkout to other commit helped you.
Tried using with several ggml bins (some from TheBloke, some from GPT4All) and it seems like this code only works with models not labeled as 4bit? Or am I missing something?
When filling out a larger instruction, the AI starts to pay less attention to the prompt and responds primarily with the instruction in mind.
I tried to fix this by removing the formation of the print input and instead giving it an initial print in init. This worked with smaller instructions but when given a longer instruction it refused to respond.
Hi
Can you make it for Android, ios and webgl. If it's works for all platforms it's more useful.
Is it possible to use these DLLs (libllama.dll, libllmodel.dll) that in your project for a Windows console application using Target Framework .NET 6 or .NET 7 to run gpt4all?
hey getting this error please help
NullReferenceException: Object reference not set to an instance of an object
Gpt4All.LlmManager.InitModel () (at ./Packages/com.gpt4all.unity/Scripts/LlmManager.cs:114)
UnityEngine.Debug:LogException(Exception)
Gpt4All.d__37:MoveNext() (at ./Packages/com.gpt4all.unity/Scripts/LlmManager.cs:121)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(LlmWrapper)
Gpt4All.d__28:MoveNext() (at ./Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:214)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
Problem:
Currently, when interacting with gpt4all, the responses are generated in a conversational format, with character-by-character animated iterations. While this format can be useful for some applications, there are cases where a more simplified response format is desired.
Proposal:
I suggest implementing an option to receive responses from gpt4all as a single, complete text without character iteration. This would make it easier for developers to integrate gpt4all into applications where an animated response is not necessary or preferred.
Thanks.
Hello :)
Really nice repo!
https://docs.gpt4all.io/
Falcon transformer architecture seems to be supported by gpt4all is it possible to add it to the library?
I Clone the repository to be able to use it, downloaded the models "ggml-mpt-7b-chat" and "ggml-gpt4all-j-v1.3-groovy", I'm using the default one and it seems to take it well, but then it gives me the following error:
DllNotFoundException: libllmodel assembly:<unknown assembly> type:<unknown type> member:(null) Gpt4All.LlmWrapper.InitFromPath (Gpt4All.LlmModelType type, System.String modelPath) (at ./Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:161) Gpt4All.LlmWrapper+<>c__DisplayClass25_0.<InitFromPathAsync>b__0 () (at ./Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:198) System.Threading.Tasks.Task
1[TResult].InnerInvoke () (at <5d4cbfbeb62e454f98e19b231866113e>:0)
System.Threading.Tasks.Task.Execute () (at <5d4cbfbeb62e454f98e19b231866113e>:0)
--- End of stack trace from previous location where exception was thrown ---
Gpt4All.LlmWrapper.InitFromPathAsync (Gpt4All.LlmModelType type, System.String modelPath) (at ./Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:199)
Gpt4All.LlmManager.InitModel () (at ./Packages/com.gpt4all.unity/Scripts/LlmManager.cs:111)
UnityEngine.Debug:LogException(Exception)
Gpt4All.d__34:MoveNext() (at ./Packages/com.gpt4all.unity/Scripts/LlmManager.cs:119)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
Gpt4All.d__25:MoveNext() (at ./Packages/com.gpt4all.unity/Scripts/LlmWrapper.cs:199)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
This message appears in the console when I hit play in the editor. I'm not sure if I'm missing a step or doing something wrong. I'm using Unity version 2022.2.9f1. I appreciate any information you can provide.
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.