Skip to content

eunsour/bentoml-transformers-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bentoml-transformers-tutorial

  1. Installation

    • BentoML requires Python 3.7 or above.
    • pip install -r requirements.txt
    • Install torch for your version
  2. Creating a Service

    1. python3 bento_packer.py

    2. bentoml list image

    3. run : bentoml serve TransformerService:latest image

    4. Go to http://localhost:5000 and check the connection

    5. Send prediction request to the service: image image

    6. Using Python3

      import requests
      res = requests.post("http://127.0.0.1:5000/predict", json={"text": "transformer"})
      print(res.text)
      
      ## "<pad> 트랜스포머</s>"
      
  3. Running the Yatai server : bentoml yatai-service-start

    Go to http://localhost:3000 and check the connection image

  4. Generate Docker Image

    • bentoml containerize TransformerService:latest
    • For Mac With Apple Silicon bentoml containerize --platform=linux/amd64 iris_classifier:latest

Running load tests using Locust

Run : locust -f locust.py

Go to http://localhost:8089 and check the connection

  • Number of users : maximum number of users
  • Spawn rate : User creations per second
  • Host : Target address

image image


Reference

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages