celinelee commited on
Commit
b551488
1 Parent(s): 70371e5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import json
3
+
4
+ # answers = json.load(open('prompting/prompt_gpt3.5_turbo.json', 'r'))
5
+ answers = json.load(open('prompting/prompt_text-davinci-003.json', 'r'))
6
+ # claude_answers = json.load(open('prompting/prompt_claude.json', 'r'))
7
+
8
+ def escape_markdown(orig_string):
9
+ return orig_string.replace('$', '\$')
10
+
11
+ question_idx = st.selectbox(f"Which question would you like to see?", range(len(answers)))
12
+
13
+ question = answers[question_idx]
14
+ st.header(f"Question {question_idx}")
15
+ q, q_s = st.columns(2)
16
+ with q:
17
+ st.subheader(f"Original question (FK={question['original_fk']}):")
18
+ st.write(escape_markdown(question['question']))
19
+ st.subheader('Answer:')
20
+ st.write(escape_markdown(question['original_answer']))
21
+ with q_s:
22
+ st.subheader(f"Simplified Question (FK={question['simplified_fk']})")
23
+ st.write(escape_markdown(question['simplified_question']))
24
+ st.subheader('Answer:')
25
+ st.write(escape_markdown(question['simplified_q_answer']))
26
+