Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,6 @@ def main():
|
|
33 |
prompt_1 = prompt_1.strip()
|
34 |
|
35 |
# Save 'prompt_1' to the chat history
|
36 |
-
#st.session_state['chat_history'] += "<div style='color: blue;'>You: </div><br><hr style='border: 1px solid black;'>"
|
37 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
38 |
st.session_state['chat_history'] += f"{prompt_1}"
|
39 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
@@ -60,7 +59,6 @@ def main():
|
|
60 |
answers_1 = '\n\n'.join(out_list)
|
61 |
|
62 |
# Save GPT's response to the chat history
|
63 |
-
#st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div><br><hr style='border: 1px solid black;'>"
|
64 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
65 |
st.session_state['chat_history'] += f"{answers_1}"
|
66 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
@@ -70,7 +68,6 @@ def main():
|
|
70 |
prompt_2 = prompt_2.strip()
|
71 |
|
72 |
# Save 'prompt_2' to the chat history
|
73 |
-
#st.session_state['chat_history'] += "<div style='color: blue;'>You: </div><br><hr style='border: 1px solid black;'>"
|
74 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
75 |
st.session_state['chat_history'] += f"{prompt_2}"
|
76 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
@@ -88,7 +85,6 @@ def main():
|
|
88 |
answers_2 = response['choices'][0]['message']['content']
|
89 |
|
90 |
# Save GPT's response to the chat history
|
91 |
-
#st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div><br><hr style='border: 1px solid black;'>"
|
92 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
93 |
st.session_state['chat_history'] += f"{answers_2}"
|
94 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
@@ -97,7 +93,6 @@ def main():
|
|
97 |
prompt_3 = answers_1 + '\n\n' + answers_2 + '\n\n' + "You are a resolver tasked with 1) finding which of the 3 answer options the researcher thought was best 2) improving that answer, and 3) printing the improved answer in full. Let's work this out in a step by step way to be sure we have the right answer:"
|
98 |
|
99 |
# Save the end of 'prompt_3' to the chat history
|
100 |
-
#st.session_state['chat_history'] += "<div style='color: blue;'>You: </div><br><hr style='border: 1px solid black;'>"
|
101 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
102 |
st.session_state['chat_history'] += "You are a resolver tasked with 1) finding which of the 3 answer options the researcher thought was best 2) improving that answer, and 3) printing the improved answer in full. Let's work this out in a step by step way to be sure we have the right answer:"
|
103 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
@@ -115,7 +110,6 @@ def main():
|
|
115 |
answers_3 = response['choices'][0]['message']['content']
|
116 |
|
117 |
# Save GPT's response to the chat history
|
118 |
-
#st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div><br><hr style='border: 1px solid black;'>"
|
119 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
120 |
st.session_state['chat_history'] += f"{answers_3}"
|
121 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
33 |
prompt_1 = prompt_1.strip()
|
34 |
|
35 |
# Save 'prompt_1' to the chat history
|
|
|
36 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
37 |
st.session_state['chat_history'] += f"{prompt_1}"
|
38 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
59 |
answers_1 = '\n\n'.join(out_list)
|
60 |
|
61 |
# Save GPT's response to the chat history
|
|
|
62 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
63 |
st.session_state['chat_history'] += f"{answers_1}"
|
64 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
68 |
prompt_2 = prompt_2.strip()
|
69 |
|
70 |
# Save 'prompt_2' to the chat history
|
|
|
71 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
72 |
st.session_state['chat_history'] += f"{prompt_2}"
|
73 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
85 |
answers_2 = response['choices'][0]['message']['content']
|
86 |
|
87 |
# Save GPT's response to the chat history
|
|
|
88 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
89 |
st.session_state['chat_history'] += f"{answers_2}"
|
90 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
93 |
prompt_3 = answers_1 + '\n\n' + answers_2 + '\n\n' + "You are a resolver tasked with 1) finding which of the 3 answer options the researcher thought was best 2) improving that answer, and 3) printing the improved answer in full. Let's work this out in a step by step way to be sure we have the right answer:"
|
94 |
|
95 |
# Save the end of 'prompt_3' to the chat history
|
|
|
96 |
st.session_state['chat_history'] += "<div style='color: blue;'>You: </div>"
|
97 |
st.session_state['chat_history'] += "You are a resolver tasked with 1) finding which of the 3 answer options the researcher thought was best 2) improving that answer, and 3) printing the improved answer in full. Let's work this out in a step by step way to be sure we have the right answer:"
|
98 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|
|
|
110 |
answers_3 = response['choices'][0]['message']['content']
|
111 |
|
112 |
# Save GPT's response to the chat history
|
|
|
113 |
st.session_state['chat_history'] += "<div style='color: red;'>MidikanGPT-4: </div>"
|
114 |
st.session_state['chat_history'] += f"{answers_3}"
|
115 |
st.session_state['chat_history'] += "<br><hr style='border: 1px solid black;'>"
|