Skip to content

Persist debug mode and use of extras to the build #304

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 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
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
18 changes: 16 additions & 2 deletions Runtime/LLMManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public class LLMManagerStore
{
public bool downloadOnStart;
public List<ModelEntry> modelEntries;
public int debugMode;
public bool fullLlamaLib;
}
/// \endcond

Expand Down Expand Up @@ -324,6 +326,8 @@ public static void LoadFromDisk()
LLMManagerStore store = JsonUtility.FromJson<LLMManagerStore>(File.ReadAllText(LLMUnitySetup.LLMManagerPath));
downloadOnStart = store.downloadOnStart;
modelEntries = store.modelEntries;
LLMUnitySetup.DebugMode = (LLMUnitySetup.DebugModeType)store.debugMode;
LLMUnitySetup.FullLlamaLib = store.fullLlamaLib;
}

#if UNITY_EDITOR
Expand Down Expand Up @@ -610,7 +614,11 @@ public static void SetLoraProgress(float progress)
/// </summary>
public static void Save()
{
string json = JsonUtility.ToJson(new LLMManagerStore { modelEntries = modelEntries, downloadOnStart = downloadOnStart }, true);
string json = JsonUtility.ToJson(new LLMManagerStore
{
modelEntries = modelEntries,
downloadOnStart = downloadOnStart,
}, true);
PlayerPrefs.SetString(LLMManagerPref, json);
PlayerPrefs.Save();
}
Expand Down Expand Up @@ -638,7 +646,13 @@ public static void SaveToDisk()
if (!modelEntry.includeInBuild) continue;
modelEntriesBuild.Add(modelEntry.OnlyRequiredFields());
}
string json = JsonUtility.ToJson(new LLMManagerStore { modelEntries = modelEntriesBuild, downloadOnStart = downloadOnStart }, true);
string json = JsonUtility.ToJson(new LLMManagerStore
{
modelEntries = modelEntriesBuild,
downloadOnStart = downloadOnStart,
debugMode = (int)LLMUnitySetup.DebugMode,
fullLlamaLib = LLMUnitySetup.FullLlamaLib
}, true);
File.WriteAllText(LLMUnitySetup.LLMManagerPath, json);
}

Expand Down
Loading