Skip to content

Instantly share code, notes, and snippets.

@i-amgeek
Last active December 25, 2019 12:11
Show Gist options
  • Select an option

  • Save i-amgeek/cf181dcf9f8a5611f72c2c73c65c5795 to your computer and use it in GitHub Desktop.

Select an option

Save i-amgeek/cf181dcf9f8a5611f72c2c73c65c5795 to your computer and use it in GitHub Desktop.

Revisions

  1. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,4 @@ def predict():
    return json.dumps(model.run(json.loads(input)))

    if __name__ == '__main__':
    app.run(debug=True, hos='0.0.0.0',port = '56733')
    app.run(debug=True, host='0.0.0.0',port = '56733')
  2. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@

    app = Flask(__name__,
    static_url_path='',
    static_folder='data/output')
    static_folder='')

    model = Model()

  3. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ def index():
    with open("info.json", "r") as f: data = eval(f.read())
    return f"Welcome to dockship. \n\n ModelName: {data['modelname']}\
    \n Short Description: {data['modelShortDescription']}\
    \n\n For any queries/problems, contact us at contact@dockship.io
    \n\n For any queries/problems, contact us at [email protected]\
    "

    @app.route('/predict', methods=['GET'])
  4. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -11,9 +11,11 @@

    @app.route('/')
    def index():
    with open("info.json", "r") as f: data = json.load(f)
    data = json.dumps(data, indent=4, sort_keys=True)
    return f"Welcome to dockship. \n\n {data}"
    with open("info.json", "r") as f: data = eval(f.read())
    return f"Welcome to dockship. \n\n ModelName: {data['modelname']}\
    \n Short Description: {data['modelShortDescription']}\
    \n\n For any queries/problems, contact us at contact@dockship.io
    "

    @app.route('/predict', methods=['GET'])
    def predict():
  5. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@
    @app.route('/')
    def index():
    with open("info.json", "r") as f: data = json.load(f)
    data = json.dumps(data, indent=4, sort_keys=True)
    return f"Welcome to dockship. \n\n {data}"

    @app.route('/predict', methods=['GET'])
  6. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@

    @app.route('/')
    def index():
    with open("
    return "Welcome to dockship"
    with open("info.json", "r") as f: data = json.load(f)
    return f"Welcome to dockship. \n\n {data}"

    @app.route('/predict', methods=['GET'])
    def predict():
  7. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@

    @app.route('/')
    def index():
    with open
    with open("
    return "Welcome to dockship"

    @app.route('/predict', methods=['GET'])
  8. i-amgeek revised this gist Dec 25, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@

    @app.route('/')
    def index():
    with open
    return "Welcome to dockship"

    @app.route('/predict', methods=['GET'])
    @@ -19,4 +20,4 @@ def predict():
    return json.dumps(model.run(json.loads(input)))

    if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0',port = '56733')
    app.run(debug=True, hos='0.0.0.0',port = '56733')
  9. i-amgeek created this gist Dec 7, 2019.
    22 changes: 22 additions & 0 deletions dockship_launch.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    from flask import Flask, request
    from run import Model
    import json


    app = Flask(__name__,
    static_url_path='',
    static_folder='data/output')

    model = Model()

    @app.route('/')
    def index():
    return "Welcome to dockship"

    @app.route('/predict', methods=['GET'])
    def predict():
    input = request.args['input']
    return json.dumps(model.run(json.loads(input)))

    if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0',port = '56733')