Spaces:
Runtime error
Runtime error
Update dashboard.py
Browse files- dashboard.py +16 -3
dashboard.py
CHANGED
@@ -1,5 +1,18 @@
|
|
1 |
-
|
|
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import matplotlib.pyplot as plt
|
2 |
+
import io
|
3 |
+
from PIL import Image
|
4 |
|
5 |
+
def update_dashboard_plot(log_data):
|
6 |
+
# Sample data visualization
|
7 |
+
labels = ["Solution 1", "Solution 2"]
|
8 |
+
values = [log_data.count("1"), log_data.count("2")]
|
9 |
|
10 |
+
fig, ax = plt.subplots()
|
11 |
+
ax.bar(labels, values)
|
12 |
+
ax.set_title("Feedback Summary")
|
13 |
+
|
14 |
+
buf = io.BytesIO()
|
15 |
+
plt.savefig(buf, format='png')
|
16 |
+
buf.seek(0)
|
17 |
+
plt.close(fig)
|
18 |
+
return Image.open(buf)
|