@@ -22,7 +22,7 @@ public LLMException(string message, int errorCode) : base(message)
22
22
}
23
23
}
24
24
25
- public class DestroyException : Exception { }
25
+ public class DestroyException : Exception { }
26
26
/// \endcond
27
27
28
28
[ DefaultExecutionOrder ( - 1 ) ]
@@ -72,7 +72,7 @@ public class LLM : MonoBehaviour
72
72
/// <summary> Chat template used for the model </summary>
73
73
[ ModelAdvanced ] public string chatTemplate = ChatTemplate . DefaultTemplate ;
74
74
/// <summary> the paths of the LORA models being used (relative to the Assets/StreamingAssets folder).
75
- /// Models with .bin format are allowed.</summary>
75
+ /// Models with .gguf format are allowed.</summary>
76
76
[ ModelAdvanced ] public string lora = "" ;
77
77
78
78
/// \cond HIDE
@@ -192,9 +192,9 @@ public void SetModel(string path)
192
192
/// <summary>
193
193
/// Allows to set a LORA model to use in the LLM.
194
194
/// The model provided is copied to the Assets/StreamingAssets folder that allows it to also work in the build.
195
- /// Models supported are in .bin format.
195
+ /// Models supported are in .gguf format.
196
196
/// </summary>
197
- /// <param name="path">path to LORA model to use (.bin format)</param>
197
+ /// <param name="path">path to LORA model to use (.gguf format)</param>
198
198
public void SetLora ( string path )
199
199
{
200
200
lora = "" ;
@@ -204,9 +204,9 @@ public void SetLora(string path)
204
204
/// <summary>
205
205
/// Allows to add a LORA model to use in the LLM.
206
206
/// The model provided is copied to the Assets/StreamingAssets folder that allows it to also work in the build.
207
- /// Models supported are in .bin format.
207
+ /// Models supported are in .gguf format.
208
208
/// </summary>
209
- /// <param name="path">path to LORA model to use (.bin format)</param>
209
+ /// <param name="path">path to LORA model to use (.gguf format)</param>
210
210
public void AddLora ( string path )
211
211
{
212
212
string loraPath = GetModelLoraPath ( path , true ) ;
@@ -220,9 +220,9 @@ public void AddLora(string path)
220
220
221
221
/// <summary>
222
222
/// Allows to remove a LORA model from the LLM.
223
- /// Models supported are in .bin format.
223
+ /// Models supported are in .gguf format.
224
224
/// </summary>
225
- /// <param name="path">path to LORA model to remove (.bin format)</param>
225
+ /// <param name="path">path to LORA model to remove (.gguf format)</param>
226
226
public void RemoveLora ( string path )
227
227
{
228
228
string loraPath = GetModelLoraPath ( path , true ) ;
@@ -373,7 +373,7 @@ void CallIfNotDestroyed(EmptyCallback fn)
373
373
private void InitService ( string arguments )
374
374
{
375
375
if ( debug ) CallIfNotDestroyed ( ( ) => SetupLogging ( ) ) ;
376
- CallIfNotDestroyed ( ( ) => { LLMObject = llmlib . LLM_Construct ( arguments ) ; } ) ;
376
+ CallIfNotDestroyed ( ( ) => { LLMObject = llmlib . LLM_Construct ( arguments ) ; } ) ;
377
377
if ( remote ) CallIfNotDestroyed ( ( ) => llmlib . LLM_StartServer ( LLMObject ) ) ;
378
378
CallIfNotDestroyed ( ( ) => llmlib . LLM_SetTemplate ( LLMObject , chatTemplate ) ) ;
379
379
CallIfNotDestroyed ( ( ) => CheckLLMStatus ( false ) ) ;
@@ -383,7 +383,7 @@ private void StartService()
383
383
{
384
384
llmThread = new Thread ( ( ) => llmlib . LLM_Start ( LLMObject ) ) ;
385
385
llmThread . Start ( ) ;
386
- while ( ! llmlib . LLM_Started ( LLMObject ) ) { }
386
+ while ( ! llmlib . LLM_Started ( LLMObject ) ) { }
387
387
loraWeights = new List < float > ( ) ;
388
388
for ( int i = 0 ; i < lora . Split ( " " ) . Count ( ) ; i ++ ) loraWeights . Add ( 1f ) ;
389
389
started = true ;
@@ -446,7 +446,7 @@ void AssertStarted()
446
446
447
447
void CheckLLMStatus ( bool log = true )
448
448
{
449
- if ( llmlib == null ) { return ; }
449
+ if ( llmlib == null ) { return ; }
450
450
IntPtr stringWrapper = llmlib . StringWrapper_Construct ( ) ;
451
451
int status = llmlib . LLM_Status ( LLMObject , stringWrapper ) ;
452
452
string result = llmlib . GetStringWrapperResult ( stringWrapper ) ;
@@ -553,7 +553,7 @@ public async Task<string> SetLoraScale(string loraToScale, float scale)
553
553
loraWeightRequest . loraWeights = new List < LoraWeightRequest > ( ) ;
554
554
for ( int i = 0 ; i < loraWeights . Count ; i ++ )
555
555
{
556
- loraWeightRequest . loraWeights . Add ( new LoraWeightRequest ( ) { id = i , scale = loraWeights [ i ] } ) ;
556
+ loraWeightRequest . loraWeights . Add ( new LoraWeightRequest ( ) { id = i , scale = loraWeights [ i ] } ) ;
557
557
}
558
558
;
559
559
@@ -607,7 +607,7 @@ public async Task<string> Slot(string json)
607
607
public async Task < string > Completion ( string json , Callback < string > streamCallback = null )
608
608
{
609
609
AssertStarted ( ) ;
610
- if ( streamCallback == null ) streamCallback = ( string s ) => { } ;
610
+ if ( streamCallback == null ) streamCallback = ( string s ) => { } ;
611
611
StreamWrapper streamWrapper = ConstructStreamWrapper ( streamCallback ) ;
612
612
await Task . Run ( ( ) => llmlib . LLM_Completion ( LLMObject , json , streamWrapper . GetStringWrapper ( ) ) ) ;
613
613
if ( ! started ) return null ;
@@ -621,7 +621,7 @@ public async Task<string> Completion(string json, Callback<string> streamCallbac
621
621
public async Task SetBasePrompt ( string base_prompt )
622
622
{
623
623
AssertStarted ( ) ;
624
- SystemPromptRequest request = new SystemPromptRequest ( ) { system_prompt = base_prompt , prompt = " " , n_predict = 0 } ;
624
+ SystemPromptRequest request = new SystemPromptRequest ( ) { system_prompt = base_prompt , prompt = " " , n_predict = 0 } ;
625
625
await Completion ( JsonUtility . ToJson ( request ) ) ;
626
626
}
627
627
0 commit comments