Skip to content

Commit ee7c6ce

Browse files
committed
use LLM manager on Editor mode otherwise GetAssetPath
1 parent 467f078 commit ee7c6ce

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Runtime/LLM.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public class LLM : MonoBehaviour
9090
public string lora = "";
9191

9292
/// \cond HIDE
93-
public LLMManager llmManager = new LLMManager();
9493

9594
IntPtr LLMObject = IntPtr.Zero;
9695
List<LLMCharacter> clients = new List<LLMCharacter>();
@@ -102,6 +101,9 @@ public class LLM : MonoBehaviour
102101
/// \endcond
103102

104103
#if UNITY_EDITOR
104+
105+
public LLMManager llmManager = new LLMManager();
106+
105107
public LLM()
106108
{
107109
LLMManager.Register(this);
@@ -171,7 +173,11 @@ protected virtual string GetLlamaccpArguments()
171173
LLMUnitySetup.LogError("No model file provided!");
172174
return null;
173175
}
176+
#if UNITY_EDITOR
177+
string modelPath = LLMManager.Get(model).path;
178+
#else
174179
string modelPath = LLMUnitySetup.GetAssetPath(model);
180+
#endif
175181
if (!File.Exists(modelPath))
176182
{
177183
LLMUnitySetup.LogError($"File {modelPath} not found!");
@@ -180,7 +186,11 @@ protected virtual string GetLlamaccpArguments()
180186
string loraPath = "";
181187
if (lora != "")
182188
{
189+
#if UNITY_EDITOR
190+
loraPath = LLMManager.Get(lora).path;
191+
#else
183192
loraPath = LLMUnitySetup.GetAssetPath(lora);
193+
#endif
184194
if (!File.Exists(loraPath))
185195
{
186196
LLMUnitySetup.LogError($"File {loraPath} not found!");

0 commit comments

Comments
 (0)