Giter Site home page Giter Site logo

bert-model-with-fast-api's Introduction

Serving the BERT model with Fast API

Classifier model BERT based.

Requirements

You'll have to install docker and docker-compose to run this project more smoothly. Official instructions here:

How to run

You have to put your trained model whithin workspace/assets/saved_model and your preprocessor in workspace/assets/saved_preprocessor. After that just launch the docker-compose:

$ docker-compose up --build

After the docker building a server containning the fastapi will be avaible. You'll see the documentation at http://localhost:8000/docs

Struct of this project

bert-model-with-fast-api
├── docker-compose.yml
├── Dockerfile
├── notebooks 
│   └── inference.ipynb # example of how do the requests
├── README.md
├── requirements.txt
└── workspace
    ├── assets
    │   ├── README.md
    │   ├── saved_model
    │   │   ├── assets
    │   │   │   └── vocab.txt
    │   │   ├── keras_metadata.pb
    │   │   ├── saved_model.pb
    │   │   └── variables
    │   │       ├── variables.data-00000-of-00001
    │   │       └── variables.index
    │   └── saved_preprocessor
    │       ├── assets
    │       │   └── vocab.txt
    │       ├── keras_metadata.pb
    │       ├── saved_model.pb
    │       └── variables
    │           ├── variables.data-00000-of-00001
    │           └── variables.index
    ├── nginx.conf      #Configuration file of the nginx server manager 
    ├── predictor.py    #FastAPI functionalities
    ├── serve           #To launch the server
    ├── source          #Folder with the classes definitions ans auxiliary functions
    │   ├── base_classes.py 
    │   ├── __init__.py
    │   └── model.py
    ├── utils
    │   ├── __init__.py
    │   └── set_gpu.py
    └── wsgi.py      #That's just a wrapp program

How to enable the GPU use:

Useful tutorials:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.