File size: 1,753 Bytes
61773dc
 
f148794
969593e
61773dc
a7c324f
bf0317f
38b6210
a7c324f
 
 
 
90bd9e6
a7c324f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51b5b49
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
license: mit
library_name: unity-sentis
pipeline_tag: text-generation
---

# Tiny Stories Model in Unity Sentis Format
This is the [Tiny Stories model](https://huggingface.co/roneneldan/TinyStories-33M) checked to run on Unity 2023. Tiny Stories is a Large Language Model that was trained on children's stories and can create stories based on the first couple of sentences.


## How to Use
* Create a new scene in Unity 2023
* Install `com.unity.sentis` and `com.unity.nuget.newtonsoft-json` packages
* Add the RunTinyStories.cs file to the Main Camera
* Put `tinystories.sentis`, `vocab.json` and `merges.txt` in the Assets/StreamingAssets folder
* Adjust some of the variables such as the `outputText` string to set the prompt
* Press run
* The output will appear in the console window

## Example Input
```
One day an alien came down from Mars. It saw a chicken
```
## Example Output
```
One day an alien came down from Mars. It saw a chicken and said, "Hello, little chicken. What are you doing here?"

The chicken replied, "I'm looking for a place to stay. I'm very tired."

The alien said, "You can stay here. I have a nice place for you. It's very comfortable."

The chicken was so happy. She thanked the alien and said, "Thank you. I'm very comfortable here."

The alien smiled and said, "You're welcome
```

## Unity Sentis
Unity Sentis is the inference engine which runs on Unity 2023. More can be found about it [here](https://unity.com/products/sentis)

## Disclaimer
The model was trained on children's stories so very unlikely to produce undesirable text. As an extra precaution, we removed a few tokens from vocab.json that might not be suitable for younger audiences. The original json can be found on the Tiny Stories original page.