Spaces:
Sleeping
Sleeping
ivnban27-ctl
commited on
Commit
•
bdf2140
1
Parent(s):
13be379
fixed bug on error reporting
Browse files
pages/manual_comparisor.py
CHANGED
@@ -45,6 +45,7 @@ def bothGood():
|
|
45 |
)
|
46 |
|
47 |
def error2db(model):
|
|
|
48 |
new_completion_error(st.session_state['db_client'],
|
49 |
st.session_state['comparison_id'],
|
50 |
username, model
|
@@ -53,7 +54,7 @@ def error2db(model):
|
|
53 |
def error2dbA():
|
54 |
error2db(sourceA)
|
55 |
|
56 |
-
def
|
57 |
error2db(sourceB)
|
58 |
|
59 |
with st.sidebar:
|
@@ -71,7 +72,7 @@ with st.sidebar:
|
|
71 |
bbad = sbcol2.button("Both are bad", on_click=regenerateBoth, disabled=disable_buttons())
|
72 |
|
73 |
errorA = sbcol1.button("Error in A", on_click=error2dbA, disabled=disable_buttons())
|
74 |
-
errorB = sbcol2.button("Error in B", on_click=
|
75 |
|
76 |
if len(comparison) > 0:
|
77 |
|
@@ -95,9 +96,9 @@ if len(comparison) > 0:
|
|
95 |
|
96 |
selectedA = random.choice(['model_one', 'model_two'])
|
97 |
selectedB = "model_two" if selectedA == "model_one" else "model_one"
|
98 |
-
logger.info(f"selected A is {selectedA} and B is {selectedB}")
|
99 |
sourceA = comparison[0]['convo_info'][0][selectedA]
|
100 |
sourceB = comparison[0]['convo_info'][0][selectedB]
|
|
|
101 |
col1.chat_message("user").write(comparison[0]["prompt"])
|
102 |
col2.chat_message("user").write(comparison[0]["prompt"])
|
103 |
|
|
|
45 |
)
|
46 |
|
47 |
def error2db(model):
|
48 |
+
logger.info(f"error logged for {model}")
|
49 |
new_completion_error(st.session_state['db_client'],
|
50 |
st.session_state['comparison_id'],
|
51 |
username, model
|
|
|
54 |
def error2dbA():
|
55 |
error2db(sourceA)
|
56 |
|
57 |
+
def error2dbB():
|
58 |
error2db(sourceB)
|
59 |
|
60 |
with st.sidebar:
|
|
|
72 |
bbad = sbcol2.button("Both are bad", on_click=regenerateBoth, disabled=disable_buttons())
|
73 |
|
74 |
errorA = sbcol1.button("Error in A", on_click=error2dbA, disabled=disable_buttons())
|
75 |
+
errorB = sbcol2.button("Error in B", on_click=error2dbB, disabled=disable_buttons())
|
76 |
|
77 |
if len(comparison) > 0:
|
78 |
|
|
|
96 |
|
97 |
selectedA = random.choice(['model_one', 'model_two'])
|
98 |
selectedB = "model_two" if selectedA == "model_one" else "model_one"
|
|
|
99 |
sourceA = comparison[0]['convo_info'][0][selectedA]
|
100 |
sourceB = comparison[0]['convo_info'][0][selectedB]
|
101 |
+
logger.info(f"selected A is {sourceA} and B is {sourceB}")
|
102 |
col1.chat_message("user").write(comparison[0]["prompt"])
|
103 |
col2.chat_message("user").write(comparison[0]["prompt"])
|
104 |
|