Skip to content

Commit 48d667f

Browse files
committed
persist debug mode and use of extras to the build
1 parent 519e70e commit 48d667f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Runtime/LLMManager.cs

+16-2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public class LLMManagerStore
9797
{
9898
public bool downloadOnStart;
9999
public List<ModelEntry> modelEntries;
100+
public int debugMode;
101+
public bool fullLlamaLib;
100102
}
101103
/// \endcond
102104

@@ -324,6 +326,8 @@ public static void LoadFromDisk()
324326
LLMManagerStore store = JsonUtility.FromJson<LLMManagerStore>(File.ReadAllText(LLMUnitySetup.LLMManagerPath));
325327
downloadOnStart = store.downloadOnStart;
326328
modelEntries = store.modelEntries;
329+
LLMUnitySetup.DebugMode = (LLMUnitySetup.DebugModeType)store.debugMode;
330+
LLMUnitySetup.FullLlamaLib = store.fullLlamaLib;
327331
}
328332

329333
#if UNITY_EDITOR
@@ -610,7 +614,11 @@ public static void SetLoraProgress(float progress)
610614
/// </summary>
611615
public static void Save()
612616
{
613-
string json = JsonUtility.ToJson(new LLMManagerStore { modelEntries = modelEntries, downloadOnStart = downloadOnStart }, true);
617+
string json = JsonUtility.ToJson(new LLMManagerStore
618+
{
619+
modelEntries = modelEntries,
620+
downloadOnStart = downloadOnStart,
621+
}, true);
614622
PlayerPrefs.SetString(LLMManagerPref, json);
615623
PlayerPrefs.Save();
616624
}
@@ -638,7 +646,13 @@ public static void SaveToDisk()
638646
if (!modelEntry.includeInBuild) continue;
639647
modelEntriesBuild.Add(modelEntry.OnlyRequiredFields());
640648
}
641-
string json = JsonUtility.ToJson(new LLMManagerStore { modelEntries = modelEntriesBuild, downloadOnStart = downloadOnStart }, true);
649+
string json = JsonUtility.ToJson(new LLMManagerStore
650+
{
651+
modelEntries = modelEntriesBuild,
652+
downloadOnStart = downloadOnStart,
653+
debugMode = (int)LLMUnitySetup.DebugMode,
654+
fullLlamaLib = LLMUnitySetup.FullLlamaLib
655+
}, true);
642656
File.WriteAllText(LLMUnitySetup.LLMManagerPath, json);
643657
}
644658

0 commit comments

Comments
 (0)