Spaces:
Running
Running
talk.wasm : move to https://whisper.ggerganov.com/talk
Browse filesThis way, we can share the same models across different WASM examples
and not have to download them for each page
- bindings/javascript/whisper.js +0 -0
- examples/talk.wasm/README.md +17 -1
- examples/talk.wasm/index-tmpl.html +6 -6
- examples/whisper.wasm/README.md +2 -2
- models/README.md +1 -1
bindings/javascript/whisper.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
examples/talk.wasm/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Talk with an Artificial Intelligence in your browser:
|
|
| 4 |
|
| 5 |
https://user-images.githubusercontent.com/1991296/203411580-fedb4839-05e4-4474-8364-aaf1e9a9b615.mp4
|
| 6 |
|
| 7 |
-
Online demo: https://
|
| 8 |
|
| 9 |
## How it works?
|
| 10 |
|
|
@@ -50,6 +50,22 @@ on a phone or a tablet. Hopefully, in the near future this will become supported
|
|
| 50 |
- Better UI (contributions are welcome)
|
| 51 |
- Better GPT-2 prompting
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
## Feedback
|
| 54 |
|
| 55 |
If you have any comments or ideas for improvement, please drop a comment in the following discussion:
|
|
|
|
| 4 |
|
| 5 |
https://user-images.githubusercontent.com/1991296/203411580-fedb4839-05e4-4474-8364-aaf1e9a9b615.mp4
|
| 6 |
|
| 7 |
+
Online demo: https://whisper.ggerganov.com/talk/
|
| 8 |
|
| 9 |
## How it works?
|
| 10 |
|
|
|
|
| 50 |
- Better UI (contributions are welcome)
|
| 51 |
- Better GPT-2 prompting
|
| 52 |
|
| 53 |
+
## Build instructions
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
# build using Emscripten (v3.1.2)
|
| 57 |
+
git clone https://github.com/ggerganov/whisper.cpp
|
| 58 |
+
cd whisper.cpp
|
| 59 |
+
mkdir build-em && cd build-em
|
| 60 |
+
emcmake cmake ..
|
| 61 |
+
make -j
|
| 62 |
+
|
| 63 |
+
# copy the produced page to your HTTP path
|
| 64 |
+
cp bin/talk.wasm/index.html /path/to/html/
|
| 65 |
+
cp bin/talk.wasm/talk.js /path/to/html/
|
| 66 |
+
cp bin/libtalk.worker.js /path/to/html/
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
## Feedback
|
| 70 |
|
| 71 |
If you have any comments or ideas for improvement, please drop a comment in the following discussion:
|
examples/talk.wasm/index-tmpl.html
CHANGED
|
@@ -35,7 +35,7 @@
|
|
| 35 |
|
| 36 |
<ul>
|
| 37 |
<li><a href="https://github.com/ggerganov/whisper.cpp">OpenAI's Whisper</a> to listen to you as you speak in the microphone</li>
|
| 38 |
-
<li><a href="https://github.com/ggerganov/
|
| 39 |
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API">Web Speech API</a> to vocalize the responses through your speakers</li>
|
| 40 |
</ul>
|
| 41 |
|
|
@@ -283,7 +283,7 @@
|
|
| 283 |
}
|
| 284 |
|
| 285 |
let dbVersion = 1
|
| 286 |
-
let dbName = '
|
| 287 |
let indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB
|
| 288 |
|
| 289 |
// fetch a remote file from remote URL using the Fetch API
|
|
@@ -439,8 +439,8 @@
|
|
| 439 |
|
| 440 |
function loadWhisper(model) {
|
| 441 |
let urls = {
|
| 442 |
-
'tiny.en': 'https://
|
| 443 |
-
'base.en': 'https://
|
| 444 |
};
|
| 445 |
|
| 446 |
let sizes = {
|
|
@@ -464,8 +464,8 @@
|
|
| 464 |
|
| 465 |
function loadGPT2(model) {
|
| 466 |
let urls = {
|
| 467 |
-
'small': 'https://
|
| 468 |
-
'medium': 'https://
|
| 469 |
};
|
| 470 |
|
| 471 |
let sizes = {
|
|
|
|
| 35 |
|
| 36 |
<ul>
|
| 37 |
<li><a href="https://github.com/ggerganov/whisper.cpp">OpenAI's Whisper</a> to listen to you as you speak in the microphone</li>
|
| 38 |
+
<li><a href="https://github.com/ggerganov/whisper.cpp/tree/master/examples/talk.wasm">OpenAI's GPT-2</a> to generate text responses</li>
|
| 39 |
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API">Web Speech API</a> to vocalize the responses through your speakers</li>
|
| 40 |
</ul>
|
| 41 |
|
|
|
|
| 283 |
}
|
| 284 |
|
| 285 |
let dbVersion = 1
|
| 286 |
+
let dbName = 'whisper.ggerganov.com';
|
| 287 |
let indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB
|
| 288 |
|
| 289 |
// fetch a remote file from remote URL using the Fetch API
|
|
|
|
| 439 |
|
| 440 |
function loadWhisper(model) {
|
| 441 |
let urls = {
|
| 442 |
+
'tiny.en': 'https://whisper.ggerganov.com/ggml-model-whisper-tiny.en.bin',
|
| 443 |
+
'base.en': 'https://whisper.ggerganov.com/ggml-model-whisper-base.en.bin',
|
| 444 |
};
|
| 445 |
|
| 446 |
let sizes = {
|
|
|
|
| 464 |
|
| 465 |
function loadGPT2(model) {
|
| 466 |
let urls = {
|
| 467 |
+
'small': 'https://whisper.ggerganov.com/ggml-model-gpt-2-117M.bin',
|
| 468 |
+
'medium': 'https://whisper.ggerganov.com/ggml-model-gpt-2-345M.bin',
|
| 469 |
};
|
| 470 |
|
| 471 |
let sizes = {
|
examples/whisper.wasm/README.md
CHANGED
|
@@ -26,10 +26,9 @@ Link: https://whisper.ggerganov.com
|
|
| 26 |
|
| 27 |

|
| 28 |
|
| 29 |
-
|
| 30 |
## Build instructions
|
| 31 |
|
| 32 |
-
```bash
|
| 33 |
# build using Emscripten
|
| 34 |
git clone https://github.com/ggerganov/whisper.cpp
|
| 35 |
cd whisper.cpp
|
|
@@ -41,3 +40,4 @@ make -j
|
|
| 41 |
cp bin/whisper.wasm/index.html /path/to/html/
|
| 42 |
cp bin/whisper.wasm/whisper.js /path/to/html/
|
| 43 |
cp bin/libwhisper.worker.js /path/to/html/
|
|
|
|
|
|
| 26 |
|
| 27 |

|
| 28 |
|
|
|
|
| 29 |
## Build instructions
|
| 30 |
|
| 31 |
+
```bash (v3.1.2)
|
| 32 |
# build using Emscripten
|
| 33 |
git clone https://github.com/ggerganov/whisper.cpp
|
| 34 |
cd whisper.cpp
|
|
|
|
| 40 |
cp bin/whisper.wasm/index.html /path/to/html/
|
| 41 |
cp bin/whisper.wasm/whisper.js /path/to/html/
|
| 42 |
cp bin/libwhisper.worker.js /path/to/html/
|
| 43 |
+
```
|
models/README.md
CHANGED
|
@@ -52,7 +52,7 @@ There are community efforts for creating fine-tuned Whisper models using extra t
|
|
| 52 |
Transformer implementation of Whisper. The produced models are in slightly different format compared to the original
|
| 53 |
OpenAI format. To read the HF models you can use the [convert-h5-to-ggml.py](convert-h5-to-ggml.py) script like this:
|
| 54 |
|
| 55 |
-
```
|
| 56 |
git clone https://github.com/openai/whisper
|
| 57 |
git clone https://github.com/ggerganov/whisper.cpp
|
| 58 |
|
|
|
|
| 52 |
Transformer implementation of Whisper. The produced models are in slightly different format compared to the original
|
| 53 |
OpenAI format. To read the HF models you can use the [convert-h5-to-ggml.py](convert-h5-to-ggml.py) script like this:
|
| 54 |
|
| 55 |
+
```bash
|
| 56 |
git clone https://github.com/openai/whisper
|
| 57 |
git clone https://github.com/ggerganov/whisper.cpp
|
| 58 |
|