Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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.
|
| 37 |
-
user_question = request.
|
| 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)))
|