|
|
--- |
|
|
library_name: sentis |
|
|
tags: |
|
|
- unity-sentis |
|
|
- onnx |
|
|
- smollm |
|
|
- causal-lm |
|
|
license: apache-2.0 |
|
|
language: |
|
|
- en |
|
|
base_model: HuggingFaceTB/SmolLM3-3B |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
# SmolLM3-3B for Unity Sentis |
|
|
|
|
|
This repository contains optimized versions of the [SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B) model, specifically formatted for use in **Unity Sentis**. |
|
|
|
|
|
## Available Versions |
|
|
|
|
|
| File Name | Format | Precision | Size | Best For | |
|
|
| :--- | :--- | :--- | :--- | :--- | |
|
|
| `model.sentis` | Sentis | FP32 | ~13GB | High-fidelity source / Desktop | |
|
|
| `model_FP16.sentis` | Sentis | FP16 | ~6.5GB | Balanced Performance / Modern GPUs | |
|
|
| `model_Uint8.sentis` | Sentis | Uint8 | ~3.3GB | Maximum Performance / Mobile / Low-end PC | |
|
|
|
|
|
## How to use in Unity |
|
|
|
|
|
1. **Install Sentis**: Ensure you have the `com.unity.sentis` package installed via the Unity Package Manager (2.1.0+ recommended). |
|
|
2. **Download Model**: Download the `.sentis` file of your choice. |
|
|
3. **Import**: Drag the `.sentis` file into your Unity Project. |
|
|
4. **Setup Tokenizer**: You will need a compatible tokenizer (like the `tokenizer.json` from the base SmolLM3 repo) to convert text to tokens. |
|
|
|
|
|
### Basic C# Loading Snippet |
|
|
```csharp |
|
|
using Unity.Sentis; |
|
|
using UnityEngine; |
|
|
|
|
|
public class MyLLM : MonoBehaviour { |
|
|
public ModelAsset modelAsset; |
|
|
private IWorker engine; |
|
|
|
|
|
void Start() { |
|
|
Model runtimeModel = ModelLoader.Load(modelAsset); |
|
|
engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, runtimeModel); |
|
|
} |
|
|
} |