Skip to content

jk195417/bert-as-service-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bert-as-service-starter

This starter include a Pipfile to install tensorflow + bert-serving-server.

Requirments

  • Git
  • Python3
  • pipenv

GPU supprt Requirments

  • Nvidia GPU
  • CUDA 9.0
  • CUDNN 7.4.2

Setup

Clone this starter:

$ git clone https://github.com/jk195417/bert-as-service-starter.git
$ cd bert-as-service-starter

Install dependencies:

$ pipenv update

Download and unzip BERT-Base, Multilingual Cased into /models dir

None GPU support

If you don't want GPU support:

$ pipenv uninstall tensorflow-gpu
$ pipenv install tensorflow

Usage

1 worker need 1G RAM, example: GTX 1060 6G can open 4 workers max.

# Start server at localhost:8125
$ pipenv run bert-serving-start -model_dir=./models/multi_cased_L-12_H-768_A-12 -num_worker=4 -http_port=8125 -http_max_connect=20

Press ctrl+c twice to shutdown server, then you can clean up those tmp dirs.