Spaces:
Sleeping
Sleeping
Commit
·
e1c5134
1
Parent(s):
853fad2
Update app.py
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def generate_answer(question,openAI_key):
|
|
115 |
"don't add any additional information. Make sure the answer is correct and don't output false content. "\
|
116 |
"If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
|
117 |
"search results which has nothing to do with the question. Only answer what is asked. The "\
|
118 |
-
"answer should be short and concise. \n\nQuery: {question}\nAnswer:
|
119 |
|
120 |
prompt += f"Query: {question}\nAnswer:"
|
121 |
answer = generate_text(openAI_key, prompt,"text-davinci-003")
|
@@ -138,8 +138,8 @@ with col1:
|
|
138 |
with col2:
|
139 |
question = st.text_input('Question')
|
140 |
with col3:
|
141 |
-
answer_placeholder = st.empty()
|
142 |
-
answer_placeholder.text_area('Answer', value=''
|
143 |
with col4:
|
144 |
if st.button('Submit'):
|
145 |
if openAI_key.strip()=='':
|
@@ -154,4 +154,4 @@ with col4:
|
|
154 |
load_recommender('corpus.pdf')
|
155 |
|
156 |
answer = generate_answer(question,openAI_key)
|
157 |
-
answer_placeholder.text_area('Answer', value=answer
|
|
|
115 |
"don't add any additional information. Make sure the answer is correct and don't output false content. "\
|
116 |
"If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
|
117 |
"search results which has nothing to do with the question. Only answer what is asked. The "\
|
118 |
+
"answer should be short and concise. \n\nQuery: {question}\nAnswer:"
|
119 |
|
120 |
prompt += f"Query: {question}\nAnswer:"
|
121 |
answer = generate_text(openAI_key, prompt,"text-davinci-003")
|
|
|
138 |
with col2:
|
139 |
question = st.text_input('Question')
|
140 |
with col3:
|
141 |
+
answer_placeholder = st.empty()
|
142 |
+
answer_placeholder.text_area('Answer', value='')
|
143 |
with col4:
|
144 |
if st.button('Submit'):
|
145 |
if openAI_key.strip()=='':
|
|
|
154 |
load_recommender('corpus.pdf')
|
155 |
|
156 |
answer = generate_answer(question,openAI_key)
|
157 |
+
answer_placeholder.text_area('Answer', value=answer)
|