Instructions to use unity/inference-engine-minilm-v6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use unity/inference-engine-minilm-v6 with unity-sentis:
string modelName = "[Your model name here].sentis"; Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); // Please see provided C# file for more details
- Notebooks
- Google Colab
- Kaggle
Bob Donovan commited on
Fix cross-platform line ending handling in LoadVocabulary
Browse filesSplit merges on '\n' and trim '\r' to support both Unix and Windows
line endings. Also filter out comment and blank lines.
- RunMiniLM.cs +9 -1
RunMiniLM.cs
CHANGED
|
@@ -29,7 +29,15 @@ public class RunMiniLM : MonoBehaviour
|
|
| 29 |
|
| 30 |
void Start()
|
| 31 |
{
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
engine = CreateMLModel();
|
| 35 |
|
|
|
|
| 29 |
|
| 30 |
void Start()
|
| 31 |
{
|
| 32 |
+
var allTokens = vocabAsset.text.Split('\n');
|
| 33 |
+
var tokenList = new List<string>();
|
| 34 |
+
foreach (var line in allTokens)
|
| 35 |
+
{
|
| 36 |
+
var trimmed = line.TrimEnd('\r');
|
| 37 |
+
if (trimmed.Length > 0)
|
| 38 |
+
tokenList.Add(trimmed);
|
| 39 |
+
}
|
| 40 |
+
tokens = tokenList.ToArray();
|
| 41 |
|
| 42 |
engine = CreateMLModel();
|
| 43 |
|