rairo commited on
Commit
12ad28b
·
verified ·
1 Parent(s): 35c4e1f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -23,18 +23,18 @@ load_dotenv()
23
 
24
 
25
  app = Flask(__name__)
26
- '''
27
  @app.route("/", methods=["GET"])
28
  def home():
29
 
30
  return "Hello Qx!"
31
- '''
32
- @app.route("/", methods=["POST"])
33
  def bot(json_table, user_question):
34
  load_dotenv()
35
  #
36
- json_table = request.args.get("json_table")
37
- user_question = request.args.get("user_question")
38
  df = pd.DataFrame(json_table)
39
  #df['Profit'] = df['Profit'].apply(lambda x: "R{:.1f}".format((x)))
40
  #df['Revenue'] = df['Revenue'].apply(lambda x: "R{:.1f}".format((x)))
 
23
 
24
 
25
  app = Flask(__name__)
26
+
27
  @app.route("/", methods=["GET"])
28
  def home():
29
 
30
  return "Hello Qx!"
31
+
32
+ @app.route("/predict", methods=["POST"])
33
  def bot(json_table, user_question):
34
  load_dotenv()
35
  #
36
+ json_table = request.json.get("json_table")
37
+ user_question = request.json.get("user_question")
38
  df = pd.DataFrame(json_table)
39
  #df['Profit'] = df['Profit'].apply(lambda x: "R{:.1f}".format((x)))
40
  #df['Revenue'] = df['Revenue'].apply(lambda x: "R{:.1f}".format((x)))