Skip to content

Instantly share code, notes, and snippets.

@rtindru
Created April 29, 2022 06:24
Show Gist options
  • Save rtindru/bdc63a2bdef83fc96a010a6a39dcf802 to your computer and use it in GitHub Desktop.
Save rtindru/bdc63a2bdef83fc96a010a6a39dcf802 to your computer and use it in GitHub Desktop.
Step 3: Package the model service
# 1) import the custom BentoService defined above
from sentiment_analysis_service import SKSentimentAnalysis
# 2) `pack` it with required artifacts, i.e. the trained model from step 1
bento_service = SKSentimentAnalysis()
bento_service.pack('model', sentiment_lr)
# 3) save your BentoSerivce to file archive
saved_path = bento_service.save()
# 4) Start a REST API model server with the BentoService saved above to serve the model
!bentoml serve SKSentimentAnalysis:latest --port=5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment