Skip to content

Commit 44e5edb

Browse files
authored
Merge pull request #4 from jgw96/webnn
if available, use webnn
2 parents cba51e6 + accbfb3 commit 44e5edb

File tree

6 files changed

+162
-324
lines changed

6 files changed

+162
-324
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Web AI Toolkit
33

4-
The Web AI Toolkit simplifies the integration of AI features, such as OCR and audio file transcription, into your application. It ensures optimal performance by running all AI workloads locally, leveraging WebGPU and WASM technologies.
4+
The Web AI Toolkit simplifies the integration of AI features, such as OCR, speech-to-text, text summarization and more into your application. It ensures data privacy and offline capability by running all AI workloads locally, leveraging WebNN when available, with a fallback to WebGPU.
55

66
## Installation
77

@@ -13,22 +13,22 @@ npm install web-ai-toolkit
1313

1414
## Available Functions
1515

16-
| Function Name | Parameter | Type | Default Value |
17-
|-----------------------|----------------|------------------------|---------------|
18-
| transcribeAudioFile | audioFile | Blob | - |
19-
| | model | string | "Xenova/whisper-tiny"|
20-
| | timestamps | boolean | false |
21-
| | language | string | "en-US" |
22-
| textToSpeech | text | string | - |
23-
| | model | string | "Xenova/mms-tts-eng"|
24-
| summarize | text | string | - |
25-
| | model | string | "Xenova/distilbart-cnn-6-6"|
26-
| ocr | image | Blob | - |
27-
| | model | string | "Xenova/trocr-small-printed|
16+
| Function Name | Parameter | Type | Default Value | Supported Hardware |
17+
|-----------------------|----------------|------------------------|---------------|--------------------|
18+
| transcribeAudioFile | audioFile | Blob | - | NPU |
19+
| | model | string | "Xenova/whisper-tiny"| |
20+
| | timestamps | boolean | false | |
21+
| | language | string | "en-US" | |
22+
| textToSpeech | text | string | - | GPU |
23+
| | model | string | "Xenova/mms-tts-eng"| |
24+
| summarize | text | string | - | GPU |
25+
| | model | string | "Xenova/distilbart-cnn-6-6"| |
26+
| ocr | image | Blob | - | GPU |
27+
| | model | string | "Xenova/trocr-small-printed"| |
2828

2929
## Technical Details
3030

31-
The Web AI Toolkit utilizes the [transformers.js project](https://huggingface.co/docs/transformers.js/index) to run AI workloads. All AI processing is performed locally on the device, ensuring data privacy and reducing latency.
31+
The Web AI Toolkit utilizes the [transformers.js project](https://huggingface.co/docs/transformers.js/index) to run AI workloads. All AI processing is performed locally on the device, ensuring data privacy and reducing latency. AI workloads are run using the [WebNN API](https://learn.microsoft.com/en-us/windows/ai/directml/webnn-overview) when available, otherwise falling back to the WebGPU API. Both of these APIs are used to "hardware accelerate" the AI inferences, with WebNN targeting NPUs and GPUs, and WebGPU strictly targeting GPUs.
3232

3333
## Usage
3434

0 commit comments

Comments
 (0)