alfraser commited on
Commit
9cec719
·
1 Parent(s): 34061f5

Updated the testing page to show the request/response pairs

Browse files
Files changed (2) hide show
  1. pages/040_Test_Reporter.py +16 -0
  2. src/testing.py +4 -1
pages/040_Test_Reporter.py CHANGED
@@ -14,6 +14,8 @@ def show_stats(for_test_group: str):
14
 
15
  stats = test_group.summary_stats_by_arch()
16
 
 
 
17
  with st.expander("**Elapsed End to End Time (seconds)**"):
18
  data = []
19
  for arch in stats:
@@ -55,6 +57,20 @@ def show_stats(for_test_group: str):
55
  st.plotly_chart(fig, use_container_width=True)
56
 
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  if st_setup('LLM Arch'):
59
  summary = st.container()
60
  with summary:
 
14
 
15
  stats = test_group.summary_stats_by_arch()
16
 
17
+ st.write("#### Statistics")
18
+
19
  with st.expander("**Elapsed End to End Time (seconds)**"):
20
  data = []
21
  for arch in stats:
 
57
  st.plotly_chart(fig, use_container_width=True)
58
 
59
 
60
+ st.write("#### Question and answer details")
61
+ questions = list(stats[0]['q_and_a'].keys())
62
+ num_archs = len(stats)
63
+ with st.expander("**Request/Response Details**"):
64
+ print(f'Displaying {len(questions)} questions and {num_archs} architectures')
65
+
66
+ for q in questions:
67
+ with st.expander(f"**{q}**"):
68
+ for i in range(num_archs):
69
+ st.divider()
70
+ st.write(f"**{stats[i]['arch_name']}**\n{stats[i]['q_and_a'][q]}")
71
+
72
+
73
+
74
  if st_setup('LLM Arch'):
75
  summary = st.container()
76
  with summary:
src/testing.py CHANGED
@@ -189,7 +189,10 @@ class TestGroup:
189
  stats = []
190
  for a in arch_names:
191
  stat_pack = {'arch_name': a, 'elapsed': [rec.elapsed for rec in arch_records[a]],
192
- 'response_len': [rec.response_len for rec in arch_records[a]], 'steps': []}
 
 
 
193
  for i in range(len(arch_records[a][0].steps)):
194
  stat_pack['steps'].append({'step_name': arch_records[a][0].steps[i].name})
195
  num_recs = len(arch_records[a])
 
189
  stats = []
190
  for a in arch_names:
191
  stat_pack = {'arch_name': a, 'elapsed': [rec.elapsed for rec in arch_records[a]],
192
+ 'response_len': [rec.response_len for rec in arch_records[a]], 'steps': [],
193
+ 'q_and_a': {}}
194
+ for rec in arch_records[a]:
195
+ stat_pack['q_and_a'][rec.request] = rec.response
196
  for i in range(len(arch_records[a][0].steps)):
197
  stat_pack['steps'].append({'step_name': arch_records[a][0].steps[i].name})
198
  num_recs = len(arch_records[a])