Skip to content

Commit 36a5a9a

Browse files
committed
start LLM always asynchronously
1 parent a70d729 commit 36a5a9a

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

Runtime/LLM.cs

+1-23
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,6 @@ public class LLM : MonoBehaviour
4545
[LLM] public bool debug = false;
4646
/// <summary> number of prompts that can happen in parallel (-1 = number of LLMCharacter objects) </summary>
4747
[LLMAdvanced] public int parallelPrompts = -1;
48-
/// <summary> allows to start the server asynchronously.
49-
/// This is useful to not block Unity while the server is initialised.
50-
/// For example it can be used as follows:
51-
/// \code
52-
/// void Start(){
53-
/// StartCoroutine(Loading());
54-
/// ...
55-
/// }
56-
///
57-
/// IEnumerator<string> Loading()
58-
/// {
59-
/// // show loading screen
60-
/// while (!llm.started)
61-
/// {
62-
/// yield return null;
63-
/// }
64-
/// Debug.Log("Server is ready");
65-
/// }
66-
/// \endcode
67-
/// </summary>
68-
[LLMAdvanced] public bool asynchronousStartup = true;
6948
/// <summary> select to not destroy the LLM GameObject when loading a new Scene. </summary>
7049
[LLMAdvanced] public bool dontDestroyOnLoad = true;
7150
/// <summary> Size of the prompt context (0 = context size of the model).
@@ -119,8 +98,7 @@ public async void Awake()
11998
await AndroidSetup();
12099
string arguments = GetLlamaccpArguments();
121100
if (arguments == null) return;
122-
if (asynchronousStartup) await Task.Run(() => StartLLMServer(arguments));
123-
else StartLLMServer(arguments);
101+
await Task.Run(() => StartLLMServer(arguments));
124102
if (dontDestroyOnLoad) DontDestroyOnLoad(transform.root.gameObject);
125103
if (basePrompt != "") await SetBasePrompt(basePrompt);
126104
}

0 commit comments

Comments
 (0)