Coder Social home page Coder Social logo

autourl's Introduction

AutoUrl

torchserve与url检测联动

steps

python url.py # generate url.pt
mkdir model_store

torch-model-archiver --model-name url \--version 1.0 \--serialized-file url.pt \--extra-files ./index_to_name.json,./MyHandler.py \--handler my_handler.py  \--export-path model_store -f

torchserve --start --model-store model_store --models url=url.mar

dokcer

docker pull pytorch/torchserve

docker run --rm --shm-size=1g \
        --ulimit memlock=-1 \
        --ulimit stack=67108864 \
        -p8080:8080 \
        -p8081:8081 \
        -p8082:8082 \
        -p7070:7070 \
        -p7071:7071 \
        --mount type=bind,source=/home/test/model_store,target=/tmp/models pytorch/torchserve:latest  torchserve --model-store=/tmp/models -

test

curl -X POST "http://localhost:8081/models?url=url.mar" # upload models

curl "http://localhost:8081/models" # check models

curl -v -X PUT "http://localhost:8081/models/url?min_worker=2

curl http://127.0.0.1:8080/predictions/url -T test.txt # no  response

reference:

https://aijishu.com/a/1060000000136517#item-3

https://github.com/FrancescoSaverioZuppichini/torchserve-tryout

https://github.com/zer0-1s/MaliciousURLs/blob/master/train_pickle.py

注:MyHandler.py参考第1,2,3个链接

autourl's People

Contributors

zer0-1s 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.