INNER CODE UNIT · Python

index

NirantK/NLP_Quickbook · Part-08 Web Deployments/api.py:32

def index():
    return flask.render_template("index.html", label=False)


@app.route("/status", methods=["GET"])
def get_status():
    return jsonify({"version": "0.0.1", "status": True})


@app.route("/predict", methods=["POST"])
def make_prediction():
    if request.method == "POST":
        # get uploaded file if it exists
        logger.debug(request.files)

        f = request.files["file"]
        f.save(f.filename)  # save file to disk
        logger.info(f"{f.filename} saved to disk")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…