Skip to content

Commit

Permalink
Merge branch 'main' into ethan/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuan8 authored Aug 22, 2024
2 parents 0a49224 + 11ff000 commit aeb33c8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 13 deletions.
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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ sdist.exclude = [
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.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
Expand Down

0 comments on commit aeb33c8

Please sign in to comment.