Skip to content

Release v2.0.3 #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
29e2703
set higher priority for mac build with Accelerate than without
amakropoulos Jun 26, 2024
0257ee7
update changelogs
amakropoulos Jun 26, 2024
93bc17f
add LLM chooser in Inspector mode
amakropoulos Jun 26, 2024
a9a77e7
update changelogs
amakropoulos Jun 28, 2024
e8b79f9
remove slot-save-path from LLM
amakropoulos Jun 26, 2024
ee8da37
use filepath instead of filename
amakropoulos Jun 26, 2024
2cc15dd
allow to save at custom paths
amakropoulos Jun 26, 2024
11eb001
bump LlamaLib to v1.1.6
amakropoulos Jun 26, 2024
64f5795
update changelogs
amakropoulos Jun 28, 2024
2d287a7
use asynchronous startup by default
amakropoulos Jul 10, 2024
27b23c7
update Samples inspector properties
amakropoulos Jul 10, 2024
f05a397
remove debug message
amakropoulos Jul 10, 2024
c9100a8
update changelogs
amakropoulos Jul 10, 2024
5e7226d
switch to LlamaLib v1.1.5
amakropoulos Jul 10, 2024
fe7a8e9
Revert "add LLM chooser in Inspector mode"
amakropoulos Jul 10, 2024
2fc0ec1
assign llm if null based on scene and hierarchy
amakropoulos Jul 10, 2024
ccd2343
update changelogs
amakropoulos Jul 10, 2024
89f271c
fix double bos at llama, rename chat model description
amakropoulos Jul 11, 2024
905ca75
update changelogs
amakropoulos Jul 11, 2024
32940d6
Log Level functionality
amakropoulos Jul 11, 2024
fefd7d3
use logl level instead of Debug.Log
amakropoulos Jul 11, 2024
e887476
add log level option, code reuse
amakropoulos Jul 11, 2024
1bbbd20
update changelogs
amakropoulos Jul 11, 2024
381c0e9
Allow to add callback functions for error messages
amakropoulos Jul 11, 2024
c7a2449
update changelogs
amakropoulos Jul 11, 2024
2ad5cd4
add interface for system prompt request
amakropoulos Jul 11, 2024
ef2c6af
implement system prompt in LLM
amakropoulos Jul 11, 2024
a60ea20
add advanced chat attribute
amakropoulos Jul 11, 2024
f3d098a
share common code
amakropoulos Jul 11, 2024
908c65f
add prompt and log level info
amakropoulos Jul 11, 2024
6980a8a
update changelogs
amakropoulos Jul 11, 2024
6751f95
make add message functions public
amakropoulos Jul 11, 2024
3c863b2
show model warning only if the llm is set
amakropoulos Jul 11, 2024
bcda8c7
add note about RAGSearchUnity requirement
amakropoulos Jul 11, 2024
73bd763
fix stop button visibility
amakropoulos Jul 11, 2024
f1d716e
link stop button to cancel requests
amakropoulos Jul 11, 2024
75eb0a1
use RuntimeInitializeOnLoadMethod when not in Unity Editor
amakropoulos Jul 11, 2024
34e0718
add exit function
amakropoulos Jul 11, 2024
1f8aaab
add exit button
amakropoulos Jul 11, 2024
4204256
fix jump link
amakropoulos Jul 11, 2024
71b36ff
fix double bos of other templates
amakropoulos Jul 11, 2024
81e3c45
fix unit test
amakropoulos Jul 11, 2024
b9e5619
Merge 81e3c454805f37195d1ab754c61288ff8ca52dd9 into 3b17c4d415da7d3e2…
amakropoulos Jul 11, 2024
88595e4
update VERSION
amakropoulos Jul 11, 2024
9ae4697
update changelog
amakropoulos Jul 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "LLM for Unity"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v2.0.2
PROJECT_NUMBER = v2.0.3

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## v2.0.3
#### 🚀 Features

- Add LLM selector in Inspector mode (PR: #182)
- Allow to save chat history at custom path (PR: #179)
- Use asynchronous startup by default (PR: #186)
- Assign LLM if not set according to the scene and hierarchy (PR: #187)
- Allow to set log level (PR: #189)
- Allow to add callback functions for error messages (PR: #190)
- Allow to set a LLM base prompt for all LLMCharacter objects (PR: #192)

#### 🐛 Fixes

- set higher priority for mac build with Accelerate than without (PR: #180)
- Fix duplicate bos warning


## v2.0.2
#### 🐛 Fixes

Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
### 🐛 Fixes
### 🚀 Features

- Add LLM selector in Inspector mode (PR: #182)
- Allow to save chat history at custom path (PR: #179)
- Use asynchronous startup by default (PR: #186)
- Assign LLM if not set according to the scene and hierarchy (PR: #187)
- Allow to set log level (PR: #189)
- Allow to add callback functions for error messages (PR: #190)
- Allow to set a LLM base prompt for all LLMCharacter objects (PR: #192)

- Fix bugs in chat completion (PR: #176)
- Call DontDestroyOnLoad on root to remove warning (PR: #174)
### 🐛 Fixes

- set higher priority for mac build with Accelerate than without (PR: #180)
- Fix duplicate bos warning

32 changes: 5 additions & 27 deletions Editor/LLMCharacterEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ protected override Type[] GetPropertyTypes()
return new Type[] { typeof(LLMCharacter) };
}

public void AddClientSettings(SerializedObject llmScriptSO)
{
List<Type> attributeClasses = new List<Type>(){typeof(LocalRemoteAttribute)};
attributeClasses.Add(llmScriptSO.FindProperty("remote").boolValue ? typeof(RemoteAttribute) : typeof(LocalAttribute));
attributeClasses.Add(typeof(LLMAttribute));
if (llmScriptSO.FindProperty("advancedOptions").boolValue)
{
attributeClasses.Add(typeof(LLMAdvancedAttribute));
}
ShowPropertiesOfClass("Setup Settings", llmScriptSO, attributeClasses, true);
}

public void AddModelSettings(SerializedObject llmScriptSO, LLMCharacter llmCharacterScript)
{
EditorGUILayout.LabelField("Model Settings", EditorStyles.boldLabel);
Expand All @@ -51,30 +39,20 @@ public void AddModelSettings(SerializedObject llmScriptSO, LLMCharacter llmChara
}
}

public void AddChatSettings(SerializedObject llmScriptSO)
{
ShowPropertiesOfClass("Chat Settings", llmScriptSO, new List<Type> { typeof(ChatAttribute) }, true);
}

public override void OnInspectorGUI()
{
LLMCharacter llmScript = (LLMCharacter)target;
SerializedObject llmScriptSO = new SerializedObject(llmScript);
llmScriptSO.Update();

GUI.enabled = false;
AddScript(llmScriptSO);
GUI.enabled = true;
EditorGUI.BeginChangeCheck();
OnInspectorGUIStart(llmScriptSO);
AddOptionsToggles(llmScriptSO);
AddClientSettings(llmScriptSO);

AddSetupSettings(llmScriptSO);
AddChatSettings(llmScriptSO);
Space();
AddModelSettings(llmScriptSO, llmScript);

if (EditorGUI.EndChangeCheck())
Repaint();

llmScriptSO.ApplyModifiedProperties();
OnInspectorGUIEnd(llmScriptSO);
}
}

Expand Down
39 changes: 3 additions & 36 deletions Editor/LLMEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ protected override Type[] GetPropertyTypes()
return new Type[] { typeof(LLM) };
}

public void AddServerLoadersSettings(SerializedObject llmScriptSO, LLM llmScript)
{
EditorGUILayout.LabelField("Setup Settings", EditorStyles.boldLabel);
AddServerSettings(llmScriptSO);
}

public void AddModelLoadersSettings(SerializedObject llmScriptSO, LLM llmScript)
{
EditorGUILayout.LabelField("Model Settings", EditorStyles.boldLabel);
Expand Down Expand Up @@ -100,24 +94,6 @@ public void AddModelSettings(SerializedObject llmScriptSO)
Space();
}

public void AddServerSettings(SerializedObject llmScriptSO)
{
List<Type> attributeClasses = new List<Type>(){typeof(LocalRemoteAttribute)};
attributeClasses.Add(llmScriptSO.FindProperty("remote").boolValue ? typeof(RemoteAttribute) : typeof(LocalAttribute));
attributeClasses.Add(typeof(LLMAttribute));
if (llmScriptSO.FindProperty("advancedOptions").boolValue)
{
attributeClasses.Add(typeof(LLMAdvancedAttribute));
}
ShowPropertiesOfClass("", llmScriptSO, attributeClasses, true);
Space();
}

public void AddChatSettings(SerializedObject llmScriptSO)
{
ShowPropertiesOfClass("Chat Settings", llmScriptSO, new List<Type> { typeof(ChatAttribute) }, false);
}

void ShowProgress(float progress, string progressText)
{
if (progress != 1) EditorGUI.ProgressBar(EditorGUILayout.GetControlRect(), progress, progressText);
Expand All @@ -126,31 +102,22 @@ void ShowProgress(float progress, string progressText)
public override void OnInspectorGUI()
{
LLM llmScript = (LLM)target;
// LLM llmScript = (LLM)target;
SerializedObject llmScriptSO = new SerializedObject(llmScript);
llmScriptSO.Update();

GUI.enabled = false;
AddScript(llmScriptSO);
GUI.enabled = true;

EditorGUI.BeginChangeCheck();
OnInspectorGUIStart(llmScriptSO);

ShowProgress(LLMUnitySetup.libraryProgress, "Setup Library");
ShowProgress(llmScript.modelProgress, "Model Downloading");
ShowProgress(llmScript.modelCopyProgress, "Model Copying");

GUI.enabled = LLMUnitySetup.libraryProgress == 1 && llmScript.modelProgress == 1 && llmScript.modelCopyProgress == 1;
AddOptionsToggles(llmScriptSO);
AddServerLoadersSettings(llmScriptSO, llmScript);
AddSetupSettings(llmScriptSO);
AddModelLoadersSettings(llmScriptSO, llmScript);
GUI.enabled = true;
AddChatSettings(llmScriptSO);

if (EditorGUI.EndChangeCheck())
Repaint();

llmScriptSO.ApplyModifiedProperties();
OnInspectorGUIEnd(llmScriptSO);
}
}
}
40 changes: 40 additions & 0 deletions Editor/PropertyEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,31 @@ public void AddOptionsToggle(SerializedObject llmScriptSO, string propertyName,
}
}

public void AddSetupSettings(SerializedObject llmScriptSO)
{
List<Type> attributeClasses = new List<Type>(){typeof(LocalRemoteAttribute)};
attributeClasses.Add(llmScriptSO.FindProperty("remote").boolValue ? typeof(RemoteAttribute) : typeof(LocalAttribute));
attributeClasses.Add(typeof(LLMAttribute));
if (llmScriptSO.FindProperty("advancedOptions").boolValue)
{
attributeClasses.Add(typeof(LLMAdvancedAttribute));
}
ShowPropertiesOfClass("Setup Settings", llmScriptSO, attributeClasses, true);
}

public void AddChatSettings(SerializedObject llmScriptSO)
{
List<Type> attributeClasses = new List<Type>(){typeof(ChatAttribute)};
if (llmScriptSO.FindProperty("advancedOptions").boolValue)
{
attributeClasses.Add(typeof(ChatAdvancedAttribute));
}
ShowPropertiesOfClass("Chat Settings", llmScriptSO, attributeClasses, false);
}

public void AddOptionsToggles(SerializedObject llmScriptSO)
{
LLMUnitySetup.SetDebugMode((LLMUnitySetup.DebugModeType)EditorGUILayout.EnumPopup("Log Level", LLMUnitySetup.DebugMode));
EditorGUILayout.BeginHorizontal();
AddOptionsToggle(llmScriptSO, "advancedOptions", "Advanced Options");
EditorGUILayout.EndHorizontal();
Expand Down Expand Up @@ -127,5 +150,22 @@ public Attribute GetPropertyAttribute(SerializedProperty prop, Type attributeCla
}
return null;
}

public void OnInspectorGUIStart(SerializedObject scriptSO)
{
scriptSO.Update();
GUI.enabled = false;
AddScript(scriptSO);
GUI.enabled = true;
EditorGUI.BeginChangeCheck();
}

public void OnInspectorGUIEnd(SerializedObject scriptSO)
{
if (EditorGUI.EndChangeCheck())
Repaint();

scriptSO.ApplyModifiedProperties();
}
}
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LLM for Unity is built on top of the awesome [llama.cpp](https://github.com/gger
<sub>
<a href="#at-a-glance" style="color: black">At a glance</a>&nbsp;&nbsp;•&nbsp;
<a href="#how-to-help" style=color: black>How to help</a>&nbsp;&nbsp;•&nbsp;
<a href="#games-using-llmCharacter-for-unity" style=color: black>Games using LLM for Unity</a>&nbsp;&nbsp;•&nbsp;
<a href="#games-using-llm-for-unity" style=color: black>Games using LLM for Unity</a>&nbsp;&nbsp;•&nbsp;
<a href="#setup" style=color: black>Setup</a>&nbsp;&nbsp;•&nbsp;
<a href="#how-to-use" style=color: black>How to use</a>&nbsp;&nbsp;•&nbsp;
<a href="#examples" style=color: black>Examples</a>&nbsp;&nbsp;•&nbsp;
Expand Down Expand Up @@ -309,6 +309,7 @@ HuggingFace models can be converted to gguf with this [online converter](https:/
### LLM Settings

- `Show/Hide Advanced Options` Toggle to show/hide advanced options from below
- `Log Level` select how verbose the log messages are

#### 💻 Setup Settings

Expand Down Expand Up @@ -345,10 +346,17 @@ If the user's GPU is not supported, the LLM will fall back to the CPU

</details>

#### 🗨️ Chat Settings
- <details><summary>Advanced options</summary>

- `Base Prompt` a common base prompt to use across all LLMCharacter objects using the LLM

</details>

### LLMCharacter Settings

- `Show/Hide Advanced Options` Toggle to show/hide advanced options from below
- `Log Level` select how verbose the log messages are

#### 💻 Setup Settings
<div>
Expand Down
Loading
Loading