Spaces:
Sleeping
Sleeping
Update: Reorder JSON object
Browse files
app.py
CHANGED
|
@@ -150,10 +150,6 @@ def predict(review: str):
|
|
| 150 |
html_out = build_svg_with_values(prediction_flavours_list)
|
| 151 |
|
| 152 |
json_out = {
|
| 153 |
-
"review": review,
|
| 154 |
-
"model": FILENAME,
|
| 155 |
-
"device": device,
|
| 156 |
-
"duration": round((t_end_flavours - t_start_flavours), 3),
|
| 157 |
"results": [{
|
| 158 |
#'icon': ICONS[name],
|
| 159 |
"name": name,
|
|
@@ -162,6 +158,10 @@ def predict(review: str):
|
|
| 162 |
}
|
| 163 |
for name, score in prediction_flavours.items()
|
| 164 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
|
| 167 |
return html_out, json_out
|
|
|
|
| 150 |
html_out = build_svg_with_values(prediction_flavours_list)
|
| 151 |
|
| 152 |
json_out = {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
"results": [{
|
| 154 |
#'icon': ICONS[name],
|
| 155 |
"name": name,
|
|
|
|
| 158 |
}
|
| 159 |
for name, score in prediction_flavours.items()
|
| 160 |
],
|
| 161 |
+
"review": review,
|
| 162 |
+
"model": FILENAME,
|
| 163 |
+
"device": device,
|
| 164 |
+
"duration": round((t_end_flavours - t_start_flavours), 3),
|
| 165 |
}
|
| 166 |
|
| 167 |
return html_out, json_out
|