Skip to content

TalkUHulk/aidb_go_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aidb-go-demo

  • CGo demo on Google Colab: Open In Colab

AiDB deployed as the server by go-zeros.

Tested Environment

  • Ubuntu 20.04.4 LTS
  • go version go1.20.5 linux/amd64

Usage

  • Clone AiDB
git clone https://github.com/TalkUHulk/ai.deploy.box
  • Compile AiDB library(custom backend)
cd ai.deploy.box
mkdir build && cd build
cmake -DC_API=ON -DENGINE_ORT=ON -DENGINE_MNN=ON -DENGINE_NCNN=ON  -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF -DENGINE_NCNN_WASM=OFF -DBUILD_SAMPLE=OFF ../
make -j8

generate libAiDB_C.so in ai.deploy.box/build/source/ and put it in internal/aidb/lib

  • prepare files demo need.

download models and unzip it then rename models, and put ai.deploy.box/extra、ai.deploy.box/config in aidb_go_demo/extra、 aidb_go_demo/config

put aidb_c_api.h in internal/aidb/include.

  • modify port

custom aidb.yaml

  • Run
export LD_LIBRARY_PATH=internal/aidb/lib:$LD_LIBRARY_PATH
go run aidb.go

  • Test

reference aidb_client.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published