Skip to content

Commit 36d428d

Browse files
committed
stamp: improving
1 parent 8df1c5b commit 36d428d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

ext/ai/README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@ features for the `Supabase.ai` namespace.
1616
`Supabase.ai` uses [onnxruntime](https://onnxruntime.ai/) as internal model
1717
execution engine, backend by [ort pyke](https://ort.pyke.io/) rust bindings.
1818

19-
<details>
20-
<summary>Javascript docs</summary>
21-
2219
The **onnxruntime** API is available from `globalThis` and shares similar specs of [onnxruntime-common](https://github.com/microsoft/onnxruntime/tree/main/js/common).
2320

2421
The available items are:
2522

26-
- `Tensor`: Represent a basic tensor with specified dimensions and data type. -- "The AI input/output"
27-
- `InferenceSession`: Represent the inner model session. -- "The AI model itself"
23+
- `Tensor`: Represent a basic tensor with specified dimensions and data type. - "The AI input/output"
24+
- `InferenceSession`: Represent the inner model session. - "The AI model itself"
2825

29-
### Usage
26+
<details>
27+
<summary>Usage</summary>
3028

31-
It can be used from the exported `globalThis[Symbol.for("onnxruntime")]` --
29+
It can be used from the exported `globalThis[Symbol.for("onnxruntime")]` -
3230
but manipulating it directly is not trivial, so in the future you may use the [Inference API #501](https://github.com/supabase/edge-runtime/pull/501) for a more user friendly API.
3331

3432
```typescript
@@ -49,6 +47,8 @@ const { last_hidden_state } = await session.run(inputs);
4947
console.log(last_hidden_state);
5048
```
5149

50+
</details>
51+
5252
### Third party libs
5353

5454
Originaly this backend was created to implicit integrate with [transformers.js](https://github.com/huggingface/transformers.js/). This way users can still consuming a high-level lib at same time they benefits of all Supabase's Model Execution Engine features, like model optimization and caching. For further information please check the [PR #436](https://github.com/supabase/edge-runtime/pull/436)
@@ -94,8 +94,6 @@ setInterval(async () => {
9494
}, 30 * 1000);
9595
```
9696

97-
</details>
98-
9997
## The `Session` class
10098

10199
Prior versions has [introduced](https://supabase.com/blog/ai-inference-now-available-in-supabase-edge-functions) the `Session` class as alternative to `transformers.js` for *gte-small* model and then was used to provide a [LLM interface](https://supabase.com/docs/guides/functions/ai-models?queryGroups=platform&platform=ollama#using-large-language-models-llm) for Ollama and some other providers.

0 commit comments

Comments
 (0)