Skip to content

Commit 3dc59af

Browse files
committed
fix for lora splitting
1 parent dfb0e6a commit 3dc59af

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Runtime/LLM.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static async Task<bool> WaitUntilModelSetup(Callback<float> downloadProgr
130130
return !modelSetupFailed;
131131
}
132132

133-
public string GetModelLoraPath(string path)
133+
public string GetModelLoraPathRuntime(string path)
134134
{
135135
string assetPath = LLMManager.GetAssetPath(path);
136136
if (!string.IsNullOrEmpty(assetPath)) return assetPath;
@@ -173,7 +173,7 @@ public void SetModel(string path)
173173
if (!string.IsNullOrEmpty(model))
174174
{
175175
ModelEntry modelEntry = LLMManager.Get(model);
176-
string template = modelEntry != null ? modelEntry.chatTemplate : ChatTemplate.FromGGUF(GetModelLoraPath(model));
176+
string template = modelEntry != null ? modelEntry.chatTemplate : ChatTemplate.FromGGUF(GetModelLoraPathRuntime(model));
177177
SetTemplate(template);
178178
}
179179
#if UNITY_EDITOR
@@ -261,16 +261,17 @@ protected virtual string GetLlamaccpArguments()
261261
LLMUnitySetup.LogError("No model file provided!");
262262
return null;
263263
}
264-
string modelPath = GetModelLoraPath(model);
264+
string modelPath = GetModelLoraPathRuntime(model);
265265
if (!File.Exists(modelPath))
266266
{
267267
LLMUnitySetup.LogError($"File {modelPath} not found!");
268268
return null;
269269
}
270270
string loraArgument = "";
271-
foreach (string lora in lora.Split(" "))
271+
foreach (string lora in lora.Trim().Split(" "))
272272
{
273-
string loraPath = GetModelLoraPath(lora);
273+
if (lora == "") continue;
274+
string loraPath = GetModelLoraPathRuntime(lora);
274275
if (!File.Exists(loraPath))
275276
{
276277
LLMUnitySetup.LogError($"File {loraPath} not found!");

0 commit comments

Comments
 (0)