Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ app.config["IMAGES_FOLDER"] = os.path.join("static", "images")
|
|
| 10 |
if not os.path.exists(app.config["UPLOAD_FOLDER"]):
|
| 11 |
os.makedirs(app.config["UPLOAD_FOLDER"])
|
| 12 |
|
| 13 |
-
with open(
|
| 14 |
answers = json.load(f)
|
| 15 |
|
| 16 |
|
|
@@ -31,6 +31,7 @@ def upload_file():
|
|
| 31 |
file.save(file_path)
|
| 32 |
df = pd.read_csv(file_path)
|
| 33 |
summary = df.describe(include="all").to_html(classes="table table-striped")
|
|
|
|
| 34 |
return jsonify(
|
| 35 |
{
|
| 36 |
"summary": summary,
|
|
@@ -97,9 +98,14 @@ def explore():
|
|
| 97 |
image_url = None
|
| 98 |
|
| 99 |
return jsonify(
|
| 100 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
)
|
| 102 |
|
| 103 |
|
| 104 |
if __name__ == "__main__":
|
| 105 |
-
app.run(
|
|
|
|
| 10 |
if not os.path.exists(app.config["UPLOAD_FOLDER"]):
|
| 11 |
os.makedirs(app.config["UPLOAD_FOLDER"])
|
| 12 |
|
| 13 |
+
with open("demo_answers.json") as f:
|
| 14 |
answers = json.load(f)
|
| 15 |
|
| 16 |
|
|
|
|
| 31 |
file.save(file_path)
|
| 32 |
df = pd.read_csv(file_path)
|
| 33 |
summary = df.describe(include="all").to_html(classes="table table-striped")
|
| 34 |
+
|
| 35 |
return jsonify(
|
| 36 |
{
|
| 37 |
"summary": summary,
|
|
|
|
| 98 |
image_url = None
|
| 99 |
|
| 100 |
return jsonify(
|
| 101 |
+
{
|
| 102 |
+
"response": response,
|
| 103 |
+
"justification": justification,
|
| 104 |
+
"image_url": image_url,
|
| 105 |
+
"key": key,
|
| 106 |
+
}
|
| 107 |
)
|
| 108 |
|
| 109 |
|
| 110 |
if __name__ == "__main__":
|
| 111 |
+
app.run(debug=True, port=7860)
|