Spaces:
Runtime error
Runtime error
Added trendline option in the scatterplot and associated update to the project requirements file for deployent on HF spaces
Browse files- pages/040_Test_Reporter.py +9 -2
- requirements.txt +1 -0
pages/040_Test_Reporter.py
CHANGED
@@ -51,9 +51,16 @@ def show_stats(for_test_group: str):
|
|
51 |
for elapsed, resp_len in zip(arch['elapsed'], arch['response_len']):
|
52 |
data.append([arch['arch_name'], elapsed / 1000, resp_len])
|
53 |
df = pd.DataFrame(data, columns=['Architecture', 'Elapsed time', 'Response length'])
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
fig.update_xaxes(tickangle=-90)
|
56 |
-
|
|
|
57 |
|
58 |
def show_q_and_a_detail(stats):
|
59 |
questions = list(stats[0]['q_and_a'].keys())
|
|
|
51 |
for elapsed, resp_len in zip(arch['elapsed'], arch['response_len']):
|
52 |
data.append([arch['arch_name'], elapsed / 1000, resp_len])
|
53 |
df = pd.DataFrame(data, columns=['Architecture', 'Elapsed time', 'Response length'])
|
54 |
+
|
55 |
+
chart_area = st.container()
|
56 |
+
if st.checkbox("Show regression lines"):
|
57 |
+
fig = px.scatter(df, x='Elapsed time', y='Response length', color='Architecture', trendline='ols', trendline_color_override='red')
|
58 |
+
|
59 |
+
else:
|
60 |
+
fig = px.scatter(df, x='Elapsed time', y='Response length', color='Architecture')
|
61 |
fig.update_xaxes(tickangle=-90)
|
62 |
+
with chart_area:
|
63 |
+
st.plotly_chart(fig, use_container_width=True)
|
64 |
|
65 |
def show_q_and_a_detail(stats):
|
66 |
questions = list(stats[0]['q_and_a'].keys())
|
requirements.txt
CHANGED
@@ -3,3 +3,4 @@ plotly==5.17.0
|
|
3 |
chromadb==0.4.15
|
4 |
better-profanity==0.7.0
|
5 |
regex==2023.10.3
|
|
|
|
3 |
chromadb==0.4.15
|
4 |
better-profanity==0.7.0
|
5 |
regex==2023.10.3
|
6 |
+
statsmodels==0.14.1
|