Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo ln -s /home/circleci/project/cmake-bin/bin/cmake /usr/local/bin/cmake
echo `cmake --version`
rm -rf /home/circleci/project/deps
DEPS_DIRECTORY=deps bash get_deps.sh cpu
bash get_deps.sh cpu
git clone git://github.com/antirez/redis.git --branch 5.0
(cd redis && make malloc=libc -j4 && sudo make install)
Expand Down
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ Expect changes in the API and internals.
If you want to run examples, make sure you have [git-lfs](https://git-lfs.github.com) installed when you clone.

## Building
This will checkout and build Redis and download the libraries for the backends (TensorFlow and PyTorch) for your platform.
This will checkout and build and download the libraries for the backends
(TensorFlow and PyTorch) for your platform.

```sh
bash get_deps.sh

```
mkdir deps
DEPS_DIRECTORY=deps bash get_deps.sh

cd deps
git clone git://github.com/antirez/redis.git --branch 5.0
cd redis
make malloc=libc -j4
cd ../..
Once the dependencies are downloaded, build the module itself. Note that
CMake 3.0 or higher is required.

```sh
mkdir build
cd build
cmake -DDEPS_PATH=../deps/install ..
Expand All @@ -38,19 +39,24 @@ docker run -p 6379:6379 -it --rm redisai/redisai
```

## Running the server
On Linux
```
LD_LIBRARY_PATH=deps/install/lib deps/redis/src/redis-server --loadmodule build/redisai.so
```

On macos
You will need a redis-server version 4.0.9 or greater. This should be
available in most recent distributions:

```sh
redis-server --version
Redis server v=4.0.9 sha=00000000:0 malloc=libc bits=64 build=c49f4faf7c3c647a
```
deps/redis/src/redis-server --loadmodule build/redisai.so

To start redis with the RedisAI module loaded:

```sh
redis-server --loadmodule build/redisai.so
```

On the client, load the model
```
./deps/redis/src/redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < graph.pb
redis-cli -x AI.MODELSET foo TF CPU INPUTS a b OUTPUTS c < graph.pb
```

Then create the input tensors, run the computation graph and get the output tensor (see `load_model.sh`). Note the signatures:
Expand Down
6 changes: 1 addition & 5 deletions get_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ set -x
BASE_DIRECTORY=`pwd`

# Allow different deps for different platforms:
PLATNAME=${OSTYPE}
if [ -e /etc/debian-version ]; then
PLATNAME=${PLATNAME}-deb
fi

if [ -z "$DEPS_DIRECTORY" ]; then
DEPS_DIRECTORY=${BASE_DIRECTORY}/deps-${PLATNAME}
DEPS_DIRECTORY=${BASE_DIRECTORY}/deps
fi

mkdir -p ${DEPS_DIRECTORY}
Expand Down