Coder Social home page Coder Social logo

widojansen / gpt-neo-deployment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiel-ai/gpt-neo-deployment

0.0 1.0 0.0 5 KB

GPT-Neo Deployment using Docker and Opyrator with API & UI

License: MIT License

Dockerfile 13.43% Python 83.62% Shell 2.96%

gpt-neo-deployment's Introduction

GPT-Neo Deployment using Docker and Opyrator (API & Streamlit UI)

GPT-Neo Deployment using Docker and Opyrator. Opyrator is building a Streamlit-based UI as well as a Rest-API with online a few lines of code. The deployment is done using Docker and traefik as a reverse-proxy; so it should work on every Cloud-Hoster or local machine. The repository is assuming you use a Nvidia GPU with CUDA for fast inference (If not, see section CPU vs. GPU for details how to use a CPU).

Unfortunately opyrator doesn't currently support running both UI and API at the same time, so in this project we set up an API and a separate UI opyrator project that calls the API-endpoint. The UI and API run on different domains.

About GTP-Neo

GTP-Neo is an Open-Source Machine-Learning model for text generation (similar to GPT-3) developed and pre-trained by EleutherAI. In this repository the EleutherAI/gpt-neo-2.7B from Huggingface is used. You can change the model used in docker-compose.yml if you prefer using a smaller one.

How to setup

First clone the repository

git clone https://github.com/Kiel-AI/gpt-neo-deployment.git && cd gpt-neo-deployment

Create an .env file and customize your environment variables. You can copy the .env.example file and customize it:

cp .env.example .env && nano .env

Make the domains point to your instance and ports 80 & 443 are open on your server. You also need to create an empty acme.json for traefik to save the certificates to:

touch acme.json && chmod 600 acme.json

CPU vs. GPU

The current setup assumes that you are running the code on a machine with a Nvidia GPU with CUDA-support (e.g. p2-2xlarge instance on AWS with AWS Deep Learning Base AMI). Using a GPU is recommended for much faster inference speed. If you would like to use CPU, check the comments in api/app.py and docker-compose.yml to see how you can switch to CPU-only.

How to run

Simply use docker-compose up. That is going to trigger the build process for the images and starts the containers. The code downloads the GPT-Neo model on building the container and stores the model inside the container, so it doesn't need to download every time you start the container.

docker-compose up -d

After that your GPT-Neo API & UI should be available under your provided domains.

gpt-neo-deployment's People

Contributors

mattinannt avatar

Watchers

 avatar

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.