Ratheeshwaraa K
Ratheeshwaraa K

Reputation: 11

To Deploy my Python machine learning model as web service

I have developed a Machine learning model in anaconda prompt using Python3 so to deploy it and to run it anywhere dynamically on GitHub or as a webservice what is the way?

I have already used Pickle command but it didn't work for me.

import pickle 
file_name = "cancerdetection.ipynb"

It didn't deploy my model as webservice.

Upvotes: 0

Views: 285

Answers (1)

Harsha Reddy
Harsha Reddy

Reputation: 421

You can try using flask. It uses python and deploys as a web application. Here's some sample code you can try.

from flask import Flask, render_template, request
app = Flask(__name__, static_url_path='/static')

@app.route('/')
def upload_file():    
    return "hello world"
if __name__ == '__main__':
    app.run(host="0.0.0.0")

By setting

host="0.0.0.0"

you're deploying your application on the net by using your local machine as a server.

Upvotes: 2

Related Questions