Spaces:
Runtime error
Runtime error
Added ability to set the number of testing threads dynamically from the UI
Browse files- pages/030_Test_Runner.py +10 -2
pages/030_Test_Runner.py
CHANGED
@@ -22,6 +22,9 @@ def display_custom_test():
|
|
22 |
st.write("### Number of questions to ask:")
|
23 |
q_count = st.slider(label="Number of questions", min_value=1, max_value=TestGenerator.question_count(), step=1)
|
24 |
|
|
|
|
|
|
|
25 |
st.write("### Tag:")
|
26 |
tag = generate_group_tag()
|
27 |
st.write(f'Test will be tagged as "{tag}" - record this for easy searching later')
|
@@ -33,7 +36,8 @@ def display_custom_test():
|
|
33 |
with st.spinner():
|
34 |
questions = TestGenerator.get_random_questions(q_count)
|
35 |
batch_test(questions=questions, architectures=selected_archs,
|
36 |
-
trace_tags=[tag, "TestRunner"], trace_comment=comment
|
|
|
37 |
|
38 |
|
39 |
def display_pricing_fact_test():
|
@@ -67,6 +71,9 @@ def display_pricing_fact_test():
|
|
67 |
st.write("### Number of questions to ask:")
|
68 |
q_count = st.slider(label="Number of questions", min_value=1, max_value=len(question_price_pairs), step=1)
|
69 |
|
|
|
|
|
|
|
70 |
st.write("### Tag:")
|
71 |
tag = generate_group_tag()
|
72 |
st.write(f'Test will be tagged as "{tag}" - record this for easy searching later')
|
@@ -84,7 +91,8 @@ def display_pricing_fact_test():
|
|
84 |
|
85 |
with st.spinner():
|
86 |
results: List[Tuple[str, str, str]] = batch_test(questions=questions, architectures=selected_archs,
|
87 |
-
trace_tags=[tag, "TestRunner"], trace_comment=comment
|
|
|
88 |
for arch, query, response in results:
|
89 |
target_price = question_price_dict[query]
|
90 |
answer_price = get_price_from_response(response)
|
|
|
22 |
st.write("### Number of questions to ask:")
|
23 |
q_count = st.slider(label="Number of questions", min_value=1, max_value=TestGenerator.question_count(), step=1)
|
24 |
|
25 |
+
st.write("### Number of threads to use for testsing:")
|
26 |
+
thread_count = st.slider(label="Number of threads", min_value=1, max_value=64, step=1, value=16, key="custom_thread_slider")
|
27 |
+
|
28 |
st.write("### Tag:")
|
29 |
tag = generate_group_tag()
|
30 |
st.write(f'Test will be tagged as "{tag}" - record this for easy searching later')
|
|
|
36 |
with st.spinner():
|
37 |
questions = TestGenerator.get_random_questions(q_count)
|
38 |
batch_test(questions=questions, architectures=selected_archs,
|
39 |
+
trace_tags=[tag, "TestRunner"], trace_comment=comment,
|
40 |
+
num_workers=thread_count)
|
41 |
|
42 |
|
43 |
def display_pricing_fact_test():
|
|
|
71 |
st.write("### Number of questions to ask:")
|
72 |
q_count = st.slider(label="Number of questions", min_value=1, max_value=len(question_price_pairs), step=1)
|
73 |
|
74 |
+
st.write("### Number of threads to use for testsing:")
|
75 |
+
thread_count = st.slider(label="Number of threads", min_value=1, max_value=64, step=1, value=16, key="pricing_thread_slider")
|
76 |
+
|
77 |
st.write("### Tag:")
|
78 |
tag = generate_group_tag()
|
79 |
st.write(f'Test will be tagged as "{tag}" - record this for easy searching later')
|
|
|
91 |
|
92 |
with st.spinner():
|
93 |
results: List[Tuple[str, str, str]] = batch_test(questions=questions, architectures=selected_archs,
|
94 |
+
trace_tags=[tag, "TestRunner"], trace_comment=comment,
|
95 |
+
num_workers=thread_count)
|
96 |
for arch, query, response in results:
|
97 |
target_price = question_price_dict[query]
|
98 |
answer_price = get_price_from_response(response)
|