Giter Club home page Giter Club logo

torchserve's Introduction

TorchServe Practice

For detailed README file, please see anthoer repository TorchServe Deployment (simplified Chinese only).

Getting Started

https://pytorch.org/serve/getting_started.html

Run

Script Model File

  1. Put script model under root folder of project, then the project structure will be like:
.  
├── script_model.pt     <--- torch script model file  
├── config.properties  
├── curl.sh  
├── data.json  
├── handler.py  
├── index_to_name.json  
├── restart.sh  
└── stop.sh  

Edit configurations

  1. Edit restart.sh, modify the project root path in line 1 and modify the conda activate path in line 2;
  2. Edit curl.sh, modify the service request url and choose the right method to send request;
  3. Edit data.json;
  4. Edit handler.py to process request data and prediction result;
  5. Edit index_to_name.json, mapping index and class name;

Start service

Give execute permission to the .sh files:

chmod +x restart.sh curl.sh stop.sh
  1. Execute restart.sh to start torchserve service;
  2. Execute curl.sh to test torchserve service;
  3. Execute stop.sh to stop torchserve service;

torchserve's People

Watchers

Anthony avatar  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.