[Python] Stuck on 'You are about to visit: xxx.ngrok.io' and cannot visit my ngrok.io webpage

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    I am using flask-ngrok to hosting an index.html webpage for my machine learning model. Code to run the webpage:

    import flask
    from flask import Flask, render_template, request
    import pickle
    import numpy as np
    from flask_ngrok import run_with_ngrok
    import warnings
    warnings.filterwarnings('ignore')

    app = Flask(__name__)
    run_with_ngrok(app)

    model = pickle.load(open('model_file.p', 'rb'))

    @app.route('/', methods=['GET'])
    def home():
    return render_template('index.html')

    @app.route('/', methods=['GET', "POST"])
    def predict():
    input_values = [float(x) for x in request.form.values()]
    inp_features = [input_values]
    prediction = model.predict(inp_features)
    if prediction > 0.5:
    return render_template('index.html', prediction_text='Predicting a Recession in the US in the near future.')
    else:
    return render_template('index.html', prediction_text='Predicting no Recession in the US in the near future.')

    app.run()


    **This runs fine, however, when I click on the xxx.ngrok.io link, then it takes me to this warning page: ** [​IMG]

    Even though I keep hitting on 'Visit Site', it never takes me to the site and just reloads the same warning page. I tried all browsers including edge. I even unblocked 3rd party cookies. Still can't avoid this.

    Continue reading...

Compartilhe esta Página