Skip to content

Commit

Permalink
Merge pull request #37 from NexaAI/zack-dev
Browse files Browse the repository at this point in the history
Update README and add -j option
  • Loading branch information
zhiyuan8 authored Aug 22, 2024
2 parents 40a911f + 0d339b1 commit 11ff000
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.10]
python-version: ["3.10"]

steps:
- name: Checkout code
Expand Down
59 changes: 47 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ check if you have GPU acceleration (torch required)
```bash
pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/cu124 --extra-index-url https://pypi.org/simple
```
Optionally, you can install onnx supported version:
```bash
pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/cu124 --extra-index-url https://pypi.org/simple
```
</details>
<details>
<summary>Apple M Chip:</summary>
Expand All @@ -58,43 +62,74 @@ check if you have GPU acceleration (torch required)
```bash
pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/metal --extra-index-url https://pypi.org/simple
```
Optionally, you can install onnx supported version:
```bash
pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/metal --extra-index-url https://pypi.org/simple
```
</details>

### CPU version

<details>
<summary>Mac with Intel chips</summary>
<summary>Mac with Intel Chips</summary>

```
To install the `nexaai` package on a Mac with Intel chips, use the following command:

```bash
CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fopenmp" pip install nexaai
```

**Optional:** To install the version with ONNX support, use:

```bash
CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fopenmp" pip install nexaai[onnx]
```

</details>

<details>
<summary>Mac with M chips or other Operating systems:</summary>
<summary>Mac with M Chips or Other Operating Systems</summary>

```
To install the `nexaai` package on a Mac with M chips or other operating systems, use the following command:

```bash
pip install nexaai
```

**Optional:** To install the version with ONNX support, use:

```bash
pip install nexaai[onnx]
```


</details>
If you prefer to install the pre-built wheel for CPU versions:

Or you prefer to install the pre-built wheel:
```bash
pip install nexaai --index-url https://nexaai.github.io/nexa-sdk/whl/cpu --extra-index-url https://pypi.org/simple
```

### Docker Usage
Note: Docker doesn't support GPU acceleration
To include ONNX support:

`docker pull nexa4ai/sdk:latest`
```bash
pip install nexaai[onnx] --index-url https://nexaai.github.io/nexa-sdk/whl/cpu --extra-index-url https://pypi.org/simple
```

### Docker Usage
Note: Docker doesn't support GPU acceleration
```bash
docker pull nexa4ai/sdk:latest
```
replace following placeholder with your path and command

`docker run -v <your_model_dir>:/model -it nexa4ai/sdk:latest [nexa_command] [your_model_relative_path]`
```bash
docker run -v <your_model_dir>:/model -it nexa4ai/sdk:latest [nexa_command] [your_model_relative_path]
```

Example:

`docker run -v /home/ubuntu/.cache/nexa/hub/official:/model -it nexa4ai/sdk:latest nexa gen-text /model/Phi-3-mini-128k-instruct/q4_0.gguf`
```bash
docker run -v /home/ubuntu/.cache/nexa/hub/official:/model -it nexa4ai/sdk:latest nexa gen-text /model/Phi-3-mini-128k-instruct/q4_0.gguf
```

will create an interactive session with text generation

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "nexaai"
version = "0.0.5"
version = "0.0.5.1"
description = "Nexa AI SDK"
readme = "README.md"
license = { text = "MIT" }
Expand Down Expand Up @@ -78,7 +78,8 @@ sdist.exclude = [".github", "build", "dist", "nexa.egg-info", "dependency/llama.
build.verbose = true
cmake.build-type = "Release"
cmake.version = ">=3.16"
# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp"]
# cmake.args = ["-DCMAKE_CXX_FLAGS=-fopenmp"] # for macOS with Intel Silicon
cmake.args = ["-DCMAKE_BUILD_PARALLEL_LEVEL=16"]

[tool.pytest.ini_options]
testpaths = ["tests"]

0 comments on commit 11ff000

Please sign in to comment.