title: Flask run on google colab: server side page loading problem
body: <p>I am trying to train an nlp model and then show the result using python and Flask, in a Google Colab Python notebook.
  In the first step I use FinBert which is financial model based on Bert neural network. it gets a text.txt file that contain news texts and the output is the sentiment of each text. Here is the problem when I try to show the output on '0.0.0.0:5000' port it fails to work.
  By the way I run my codes on 'google colab'.</p>
  <pre><code>here is the code: 
  from flask import Flask
  from flask_cors import CORS
  import sys
  import optparse
  import time
  from flask import request
  import sys
  from finbert.finbert import predict
  from pytorch_pretrained_bert.modeling import BertForSequenceClassification
  import nltk
  
  nltk.download('punkt')
  app = Flask(__name__)
  CORS(app)
  start = int(round(time.time()))
  model = BertForSequenceClassification.from_pretrained('./models/', num_labels=3, cache_dir=None)
  
  @app.route(&quot;/&quot;,methods=['POST'])
  def score():
      text=request.get_json()['text']
      return(predict(text, model).to_json(orient='records'))
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0', port=5000, debug=False, threaded=True)
  </code></pre>
  <p>I want to check if the problem is from model or not so I delete the flask part and just pass some text to the model and it works fine. Therefore there is some problem with flask which I can't fined (completely new to flask).<br />
  <a href="https://i.stack.imgur.com/mkjdN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mkjdN.png" alt="enter image description here" /></a></p>