Spaces:
Sleeping
Sleeping
vickeee465
commited on
Commit
·
0bade3d
1
Parent(s):
40de5cf
bugfix?
Browse files
app.py
CHANGED
@@ -80,13 +80,13 @@ def prepare_heatmap_data(data):
|
|
80 |
|
81 |
heatmap_data = pd.DataFrame(0.0, index=range(len(data)), columns=id2label.values())
|
82 |
|
83 |
-
for idx,
|
84 |
-
print(f"DEBUG: Item at index {idx}: {
|
85 |
|
86 |
-
if not isinstance(
|
87 |
-
raise TypeError(f"Expected dict, but got {type(
|
88 |
|
89 |
-
confidences =
|
90 |
for idy, confidence in enumerate(confidences):
|
91 |
emotion = id2label[idy]
|
92 |
heatmap_data.at[idx, emotion] = confidence
|
|
|
80 |
|
81 |
heatmap_data = pd.DataFrame(0.0, index=range(len(data)), columns=id2label.values())
|
82 |
|
83 |
+
for idx, row in enumerate(data):
|
84 |
+
print(f"DEBUG: Item at index {idx}: {row} (type: {type(row)})")
|
85 |
|
86 |
+
if not isinstance(row, dict):
|
87 |
+
raise TypeError(f"Expected dict, but got {type(row)} at index {idx}: {row}")
|
88 |
|
89 |
+
confidences = row["emotions"].tolist()
|
90 |
for idy, confidence in enumerate(confidences):
|
91 |
emotion = id2label[idy]
|
92 |
heatmap_data.at[idx, emotion] = confidence
|