Skip to content

Commit

Permalink
Update build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
vishniakov-nikolai committed Dec 12, 2024
1 parent df51af9 commit a365ef8
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions src/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,40 @@ This is preview version, do not use it in production!

### Build Bindings

TODO: Add instructions
#### Build OpenVINO GenAI as OpenVINO Extra Module

OpenVINO GenAI Node.js bindings can be built as an extra module during the OpenVINO build process. This method simplifies the build process by integrating OpenVINO GenAI directly into the OpenVINO build.

1. Clone OpenVINO repository:
```sh
git clone --recursive https://github.com/openvinotoolkit/openvino.git
```
1. Configure CMake with OpenVINO extra modules:
```sh
cmake -DOPENVINO_EXTRA_MODULES=*relative (from openvino folder) path to genai repository* -DCPACK_ARCHIVE_COMPONENT_INSTALL=OFF \
-DCPACK_GENERATOR=NPM -DENABLE_JS=ON -UTBB* -DENABLE_SYSTEM_TBB=OFF \
-DENABLE_PYTHON=OFF \
-DENABLE_WHEEL=OFF \
-DCPACK_PACKAGE_FILE_NAME=genai_nodejs_bindings \
-S ./openvino -B ./build
```
1. Build OpenVINO archive with GenAI:
```sh
cmake --build ./build --target package -j
```

1. In `build` folder you will find `genai_nodejs_bindings.tar.gz`.
Create `bin` directory by path `src/js/` and unarchive archive content to it.
1. Run tests to be sure that everything works:
`npm test`

### Perform Test Run

- To run sample you should have prepared model.
Use this instruction [to download model](https://github.com/openvinotoolkit/openvino.genai/blob/master/samples/cpp/chat_sample/README.md#download-and-convert-the-model-and-tokenizers)
- Go to [samples/js](../../samples/js/)
- Run `node app.js`, you should see: `User Prompt: ...`
Use this instruction [to download model](https://github.com/openvinotoolkit/openvino.genai/blob/master/samples/js/chat_sample/README.md#download-and-convert-the-model-and-tokenizers)
- Go to [samples/js/chat_sample/](../../samples/js/chat_sample/)
- Read [README.md](../../samples/js/chat_sample/README.md) and follow steps there
to run **chat sample**.

### Using as npm Dependency

Expand Down

0 comments on commit a365ef8

Please sign in to comment.