You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/ai/README.md
+7-9Lines changed: 7 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -16,19 +16,17 @@ features for the `Supabase.ai` namespace.
16
16
`Supabase.ai` uses [onnxruntime](https://onnxruntime.ai/) as internal model
17
17
execution engine, backend by [ort pyke](https://ort.pyke.io/) rust bindings.
18
18
19
-
<details>
20
-
<summary>Javascript docs</summary>
21
-
22
19
The **onnxruntime** API is available from `globalThis` and shares similar specs of [onnxruntime-common](https://github.com/microsoft/onnxruntime/tree/main/js/common).
23
20
24
21
The available items are:
25
22
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"
28
25
29
-
### Usage
26
+
<details>
27
+
<summary>Usage</summary>
30
28
31
-
It can be used from the exported `globalThis[Symbol.for("onnxruntime")]` --
29
+
It can be used from the exported `globalThis[Symbol.for("onnxruntime")]` -
32
30
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.
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 () => {
94
94
}, 30*1000);
95
95
```
96
96
97
-
</details>
98
-
99
97
## The `Session` class
100
98
101
99
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