This way, we can share the same models across different WASM examples
and not have to download them for each page
pull/183/head
Georgi Gerganov 2022-11-24 18:24:06 +02:00
parent a2ecd54455
commit abce28ea99
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
5 changed files with 27 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ Talk with an Artificial Intelligence in your browser:
https://user-images.githubusercontent.com/1991296/203411580-fedb4839-05e4-4474-8364-aaf1e9a9b615.mp4 https://user-images.githubusercontent.com/1991296/203411580-fedb4839-05e4-4474-8364-aaf1e9a9b615.mp4
Online demo: https://talk.ggerganov.com Online demo: https://whisper.ggerganov.com/talk/
## How it works? ## How it works?
@ -50,6 +50,22 @@ on a phone or a tablet. Hopefully, in the near future this will become supported
- Better UI (contributions are welcome) - Better UI (contributions are welcome)
- Better GPT-2 prompting - Better GPT-2 prompting
## Build instructions
```bash
# build using Emscripten (v3.1.2)
git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
mkdir build-em && cd build-em
emcmake cmake ..
make -j
# copy the produced page to your HTTP path
cp bin/talk.wasm/index.html /path/to/html/
cp bin/talk.wasm/talk.js /path/to/html/
cp bin/libtalk.worker.js /path/to/html/
```
## Feedback ## Feedback
If you have any comments or ideas for improvement, please drop a comment in the following discussion: If you have any comments or ideas for improvement, please drop a comment in the following discussion:

View File

@ -35,7 +35,7 @@
<ul> <ul>
<li><a href="https://github.com/ggerganov/whisper.cpp">OpenAI's Whisper</a> to listen to you as you speak in the microphone</li> <li><a href="https://github.com/ggerganov/whisper.cpp">OpenAI's Whisper</a> to listen to you as you speak in the microphone</li>
<li><a href="https://github.com/ggerganov/ggml/tree/master/examples/gpt-2">OpenAI's GPT-2</a> to generate text responses</li> <li><a href="https://github.com/ggerganov/whisper.cpp/tree/master/examples/talk.wasm">OpenAI's GPT-2</a> to generate text responses</li>
<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> <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>
</ul> </ul>
@ -283,7 +283,7 @@
} }
let dbVersion = 1 let dbVersion = 1
let dbName = 'talk.ggerganov.com'; let dbName = 'whisper.ggerganov.com';
let indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB let indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB
// fetch a remote file from remote URL using the Fetch API // fetch a remote file from remote URL using the Fetch API
@ -439,8 +439,8 @@
function loadWhisper(model) { function loadWhisper(model) {
let urls = { let urls = {
'tiny.en': 'https://talk.ggerganov.com/ggml-model-whisper-tiny.en.bin', 'tiny.en': 'https://whisper.ggerganov.com/ggml-model-whisper-tiny.en.bin',
'base.en': 'https://talk.ggerganov.com/ggml-model-whisper-base.en.bin', 'base.en': 'https://whisper.ggerganov.com/ggml-model-whisper-base.en.bin',
}; };
let sizes = { let sizes = {
@ -464,8 +464,8 @@
function loadGPT2(model) { function loadGPT2(model) {
let urls = { let urls = {
'small': 'https://talk.ggerganov.com/ggml-model-gpt-2-117M.bin', 'small': 'https://whisper.ggerganov.com/ggml-model-gpt-2-117M.bin',
'medium': 'https://talk.ggerganov.com/ggml-model-gpt-2-345M.bin', 'medium': 'https://whisper.ggerganov.com/ggml-model-gpt-2-345M.bin',
}; };
let sizes = { let sizes = {

View File

@ -26,10 +26,9 @@ Link: https://whisper.ggerganov.com
![image](https://user-images.githubusercontent.com/1991296/197348344-1a7fead8-3dae-4922-8b06-df223a206603.png) ![image](https://user-images.githubusercontent.com/1991296/197348344-1a7fead8-3dae-4922-8b06-df223a206603.png)
## Build instructions ## Build instructions
```bash ```bash (v3.1.2)
# build using Emscripten # build using Emscripten
git clone https://github.com/ggerganov/whisper.cpp git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp cd whisper.cpp
@ -41,3 +40,4 @@ make -j
cp bin/whisper.wasm/index.html /path/to/html/ cp bin/whisper.wasm/index.html /path/to/html/
cp bin/whisper.wasm/whisper.js /path/to/html/ cp bin/whisper.wasm/whisper.js /path/to/html/
cp bin/libwhisper.worker.js /path/to/html/ cp bin/libwhisper.worker.js /path/to/html/
```

View File

@ -52,7 +52,7 @@ There are community efforts for creating fine-tuned Whisper models using extra t
Transformer implementation of Whisper. The produced models are in slightly different format compared to the original Transformer implementation of Whisper. The produced models are in slightly different format compared to the original
OpenAI format. To read the HF models you can use the [convert-h5-to-ggml.py](convert-h5-to-ggml.py) script like this: OpenAI format. To read the HF models you can use the [convert-h5-to-ggml.py](convert-h5-to-ggml.py) script like this:
``` ```bash
git clone https://github.com/openai/whisper git clone https://github.com/openai/whisper
git clone https://github.com/ggerganov/whisper.cpp git clone https://github.com/ggerganov/whisper.cpp