Installation: Python Clients
This page covers the installation of the Python clients. Please visit this page for instructions on installing the Inference Server and Training Module.
The Python clients allow you to interact with the NuPIC Inference Server and Training Module. By leveraging these clients, you can efficiently manage dependencies, fine-tune your model with optimized computational resources and deploy models for inference with minimal overhead.
Installation Options
The clients can be installed on the same machine as the Inference Server and Training Module. This is suitable for evaluation purposes. In a production scenario, the clients will most likely be installed on end-user machines, and will facilitate communication with the Inference Server and Training Modules running on remote infrastructure. See this page for details on installation options.
Directory Structure
From the nupic/
directory, navigate to the nupic.examples/
folder:
cd nupic.examples
The folder should look like this:
nupic.examples/
├── create_examples_venv.sh ---------> Defines virtual environment
├── environment.yml -----------------> Defines conda environment
├── examples/ -----------------------> Example code for specific use-cases
├── inference_server_versions
├── LICENSE
├── licenses/
├── MANIFEST.in
├── pyproject.toml
├── README.md
├── scripts/
├── setup.cfg
├── setup.py
├── src/nupic/client
│ └──
│ ├── inference_client.py ---------> Interacts with Inference Server
│ ├── __init__.py
│ ├── langchain
│ ├── nupic_train.py
│ ├── README.md
│ ├── requirements.txt
│ └── training_client.py ----------> Interacts with Training Module
├── tests/
└── training_module_versions
Installing Dependencies
There are two ways to install Python libraries needed for NuPIC clients: venv or conda.
Option 1: venv
This installs creates a virtual environment and installs the necessary dependencies:
source create_examples_venv.sh
When successful, you should see the newly-created virtual environment prepended to your shell prompt:
(nupic_examples_env) ubuntu@ip-10-0-5-96:~/nupic/nupic.examples$
Option 2: conda
Alternatively, if you prefer using conda, you can run the following command:
conda env create
conda activate nupic.examples
You should see the newly activated conda environment prepended to your shell prompt:
(nupic.examples) ubuntu@ip-10-0-5-96:~/nupic/nupic.examples$
Option 3: Just the Clients
A more lightweight alternative is to only install the dependencies that are strictly required for the Python clients. This approach does not install the dependencies needed for some of the examples in nupic.examples/examples
.
This method is recommended only for advanced users who do not require our worked examples for reference. We recommend running the following command in the virtual environment of your choice:
pip install ./
Updated 9 months ago