Instructions to use unity/inference-engine-tiny-stories with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use unity/inference-engine-tiny-stories 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.
- RunTinyStories.cs +9 -1
RunTinyStories.cs
CHANGED
|
@@ -130,7 +130,15 @@ public class RunTinyStories : MonoBehaviour
|
|
| 130 |
tokens[item.Value] = item.Key;
|
| 131 |
}
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
| 135 |
|
| 136 |
// Translates encoded special characters to Unicode
|
|
|
|
| 130 |
tokens[item.Value] = item.Key;
|
| 131 |
}
|
| 132 |
|
| 133 |
+
var allMerges = mergesAsset.text.Split('\n');
|
| 134 |
+
var mergeList = new List<string>();
|
| 135 |
+
foreach (var line in allMerges)
|
| 136 |
+
{
|
| 137 |
+
var trimmed = line.TrimEnd('\r');
|
| 138 |
+
if (trimmed.Length > 0 && trimmed[0] != '#')
|
| 139 |
+
mergeList.Add(trimmed);
|
| 140 |
+
}
|
| 141 |
+
merges = mergeList.ToArray();
|
| 142 |
}
|
| 143 |
|
| 144 |
// Translates encoded special characters to Unicode
|