diff --git a/README.md b/README.md index d4e6f7f..aa3ca0f 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,36 @@ -# ggml.js +
+ ggml.js logo +
-Run any [ggml](https://github.com/ggerganov/ggml.git) ported models directly from your browser with ggml.js +

+ no-languages + commit-activity + stars +

-## Build +# ggml.js -You can follow the [BUILD.md](docs/BUILD.md) guide to build ggml.js JavaScript bundles. +> Run any [ggml](https://github.com/ggerganov/ggml.git) ported ML models directly on your web browser with ggml.js -## Examples +Example projects built with ggml.js: [Live Demo](https://rahuldshetty.github.io/ggml.js-examples/) -Get started with some example projects: +You can find the package documentation for this project: [Documentation](https://rahuldshetty.github.io/ggml.js/) -| Name | Description | Source code | -|-------------------|----------------------------------|-------------------------------| -| Tiny Starcoder | Demo on [tiny starcoder](https://huggingface.co/bigcode/tiny_starcoder_py) | [link](examples/basic.html) | \ No newline at end of file +Models Supported: +- [Dolly v2](https://github.com/ggerganov/ggml/tree/master/examples/dolly-v2) +- [GPT2](https://github.com/ggerganov/ggml/tree/master/examples/gpt-2) +- [GPT J](https://github.com/ggerganov/ggml/tree/master/examples/gpt-j) +- [GPT NEO X](https://github.com/ggerganov/ggml/tree/master/examples/gpt-neox) +- [MPT](https://github.com/ggerganov/ggml/tree/master/examples/mpt) +- [Replit](https://github.com/ggerganov/ggml/tree/master/examples/replit) +- [StarCoder](https://github.com/ggerganov/ggml/tree/master/examples/starcoder) + +*More models will be added in future* + +## Installation + +Download and extract latest [release](https://github.com/rahuldshetty/ggml.js/releases) of ggml.js package to your web project. + +*OR* + +You can follow the [Build](/BUILD.md) guide to generate ggml.js JavaScript bundles from scratch. diff --git a/docs/README.md b/docs/README.md index 1bd53a5..5fdb103 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,6 +2,10 @@ Run any [ggml](https://github.com/ggerganov/ggml.git) ported ML models directly on your web browser with ggml.js +ggml.js provides JavaScript bindings for interacting with GGML quantized ML models. + +Example projects built with ggml.js: [Live Demo](https://rahuldshetty.github.io/ggml.js-examples/) + Models Supported: - [Dolly v2](https://github.com/ggerganov/ggml/tree/master/examples/dolly-v2) - [GPT2](https://github.com/ggerganov/ggml/tree/master/examples/gpt-2) @@ -11,7 +15,7 @@ Models Supported: - [Replit](https://github.com/ggerganov/ggml/tree/master/examples/replit) - [StarCoder](https://github.com/ggerganov/ggml/tree/master/examples/starcoder) - +*More models will be added in future* ## Installation diff --git a/docs/_coverpage.md b/docs/_coverpage.md index eab8a0c..8e4e44f 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,11 +1,14 @@ + + # ggml.js 1.0.0 > Run any [ggml](https://github.com/ggerganov/ggml.git) ported ML models directly on your browser - Serverless & Edge AI 🤖 - JavaScript ES6 Package 🧰 +- Powered by WebAssembly [GitHub](https://github.com/rahuldshetty/ggml.js.git) [Get Started](#ggmljs) diff --git a/docs/_media/icon-512.png b/docs/_media/icon-512.png new file mode 100644 index 0000000..5646b17 Binary files /dev/null and b/docs/_media/icon-512.png differ diff --git a/docs/_media/logo.png b/docs/_media/logo.png new file mode 100644 index 0000000..0e60cbf Binary files /dev/null and b/docs/_media/logo.png differ diff --git a/docs/_media/logo.pxz b/docs/_media/logo.pxz new file mode 100644 index 0000000..c9f889c Binary files /dev/null and b/docs/_media/logo.pxz differ diff --git a/docs/examples.md b/docs/examples.md index 45d24de..822a283 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -1,9 +1,9 @@ # Examples -Get started with some example projects: +Get started with some example [projects](https://rahuldshetty.github.io/ggml.js-examples/). | Name | Description | Source code | |-------------------|----------------------------------|-------------------------------| -| Tiny Starcoder | Demo on [tiny starcoder](https://huggingface.co/bigcode/tiny_starcoder_py) | [link](https://github.com/rahuldshetty/ggml.js/blob/master/examples/starcoder.html) | -| GPT 2 Roleplay | Demo on [GPT2-RPGPT-8.48M](https://huggingface.co/xzuyn/GPT2-RPGPT-8.48M) | [link](https://github.com/rahuldshetty/ggml.js/blob/master/examples/gpt2_roleplay.html) | - +| [Quick Start](https://rahuldshetty.github.io/ggml.js-examples/quick-start/index.html) | Basic demo example | [link](https://github.com/rahuldshetty/ggml.js-examples/tree/master/quick-start) | +| [Tiny Starcoder](https://rahuldshetty.github.io/ggml.js-examples/starcoder.html) | Demo on [tiny starcoder](https://huggingface.co/bigcode/tiny_starcoder_py) | [link](https://github.com/rahuldshetty/ggml.js-examples/blob/master/starcoder.html) | +| [GPT 2 Roleplay](https://rahuldshetty.github.io/ggml.js-examples/gpt2_roleplay.html) | Demo on [GPT2-RPGPT-8.48M](https://huggingface.co/xzuyn/GPT2-RPGPT-8.48M) | [link](https://github.com/rahuldshetty/ggml.js-examples/blob/master/gpt2_roleplay.html) | \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index accc68b..888076c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,6 +26,7 @@ loadSidebar: true, coverpage: true, executeScript: true, + autoHeader: true, } diff --git a/docs/quick_start.md b/docs/quick_start.md index 0e31001..dbd56a8 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -35,7 +35,7 @@ Let us create a simple HTML file. ``` - +Let's define a JS script file to load model with ggml.js library and run ML inference on browser. `script.js` ```js diff --git a/examples/gpt2_roleplay.html b/examples/gpt2_roleplay.html deleted file mode 100644 index 6eaf368..0000000 --- a/examples/gpt2_roleplay.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - starcoder.js - - - - - -
-

ggml.js

- -

Demo

- - -
- - - -
- Model Parameters - -
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
-
- - -
- -
-

Result

-
-
-
- - - - - \ No newline at end of file diff --git a/examples/quick_start/index.html b/examples/quick_start/index.html deleted file mode 100644 index 8da39ce..0000000 --- a/examples/quick_start/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - -
-        
-
- - - - \ No newline at end of file diff --git a/examples/quick_start/script.js b/examples/quick_start/script.js deleted file mode 100644 index 2e5af68..0000000 --- a/examples/quick_start/script.js +++ /dev/null @@ -1,42 +0,0 @@ -// Import GGML wrapper -import {GGML} from "../../dist/ggml.js"; - -// State variable to track model load status -var model_loaded = false; - -// Initial Prompt -var initial_prompt = "def fibonacci(n):" - -// Callback functions -const on_loaded = () => { - model_loaded = true; -} -const write_result = (text) => { document.getElementById('result').innerText += text + "\n" } -const run_complete = () => {} - -// GGML wrapper -const app = new GGML( - 'STARCODER', // Type of Model - 'https://huggingface.co/rahuldshetty/ggml.js/resolve/main/starcoder.bin', // Model URL - on_loaded, // On Model Load callback function - write_result, // On Model write callback function - run_complete // On Model completion callback function -); - -// Download & Load Model GGML bin file -app.load_worker(); - -// Trigger model once its loaded -const checkInterval = setInterval(timer, 5000); - -function timer() { - if(model_loaded){ - app.run({ - prompt: initial_prompt, - top_k: 1 - }); - clearInterval(checkInterval); - } else{ - console.log('Waiting...') - } -} diff --git a/examples/starcoder.html b/examples/starcoder.html deleted file mode 100644 index ba8d365..0000000 --- a/examples/starcoder.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - starcoder.js - - - - - -
-

ggml.js

- -

Demo

- - -
- - - -
- Model Parameters - -
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
-
-
- - -
- -
-

Result

-
-
-
- - - - - \ No newline at end of file