@@ -163,11 +163,11 @@ public async Task DownloadDefaultModel(int optionIndex)
163
163
await DownloadModel ( modelUrl , modelName ) ;
164
164
}
165
165
166
- public async Task DownloadModel ( string modelUrl , string modelName , bool overwrite = false )
166
+ public async Task DownloadModel ( string modelUrl , string modelName , bool overwrite = false , bool setTemplate = true )
167
167
{
168
168
modelProgress = 0 ;
169
169
string modelPath = LLMUnitySetup . GetAssetPath ( modelName ) ;
170
- await LLMUnitySetup . DownloadFile ( modelUrl , modelPath , overwrite , SetModel , SetModelProgress ) ;
170
+ await LLMUnitySetup . DownloadFile ( modelUrl , modelPath , overwrite , ( string path ) => SetModel ( path , setTemplate ) , SetModelProgress ) ;
171
171
}
172
172
173
173
public async Task DownloadLora ( string loraUrl , string loraName , bool overwrite = false )
@@ -177,10 +177,10 @@ public async Task DownloadLora(string loraUrl, string loraName, bool overwrite =
177
177
await LLMUnitySetup . DownloadFile ( loraUrl , loraPath , overwrite , SetLora , SetLoraProgress ) ;
178
178
}
179
179
180
- public async Task DownloadModels ( )
180
+ public async Task DownloadModels ( bool overwrite = false )
181
181
{
182
- if ( modelURL != "" ) await DownloadModel ( modelURL , model ) ;
183
- if ( loraURL != "" ) await DownloadLora ( loraURL , lora ) ;
182
+ if ( modelURL != "" ) await DownloadModel ( modelURL , model , overwrite , false ) ;
183
+ if ( loraURL != "" ) await DownloadLora ( loraURL , lora , overwrite ) ;
184
184
}
185
185
186
186
public async Task AndroidExtractModels ( )
@@ -209,11 +209,11 @@ public async Task WaitUntilReady()
209
209
/// Models supported are in .gguf format.
210
210
/// </summary>
211
211
/// <param name="path">path to model to use (.gguf format)</param>
212
- public void SetModel ( string path )
212
+ public void SetModel ( string path , bool setTemplate = true )
213
213
{
214
214
// set the model and enable the model editor properties
215
215
model = CopyAsset ( path ) ;
216
- SetTemplate ( ChatTemplate . FromGGUF ( LLMUnitySetup . GetAssetPath ( model ) ) ) ;
216
+ if ( setTemplate ) SetTemplate ( ChatTemplate . FromGGUF ( LLMUnitySetup . GetAssetPath ( model ) ) ) ;
217
217
#if UNITY_EDITOR
218
218
if ( ! EditorApplication . isPlaying ) EditorUtility . SetDirty ( this ) ;
219
219
#endif
0 commit comments