Spaces:
Runtime error
Runtime error
bhaskartripathi
commited on
Commit
•
55ecb25
1
Parent(s):
4a41d09
Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,6 @@ def generate_answer(question,openAI_key):
|
|
117 |
topn_chunks = recommender(question)
|
118 |
prompt = ""
|
119 |
prompt += 'search results:\n\n'
|
120 |
-
max_prompt_tokens = 4096 - 512 # leave room for completion
|
121 |
for c in topn_chunks:
|
122 |
prompt += c + '\n\n'
|
123 |
|
@@ -128,7 +127,7 @@ def generate_answer(question,openAI_key):
|
|
128 |
"don't add any additional information. Make sure the answer is correct and don't output false content. "\
|
129 |
"If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
|
130 |
"search results which has nothing to do with the question. Only answer what is asked. The "\
|
131 |
-
"answer should be short and concise.
|
132 |
|
133 |
prompt += f"Query: {question}\nAnswer:"
|
134 |
answer = generate_text(openAI_key, prompt,"text-davinci-003")
|
|
|
117 |
topn_chunks = recommender(question)
|
118 |
prompt = ""
|
119 |
prompt += 'search results:\n\n'
|
|
|
120 |
for c in topn_chunks:
|
121 |
prompt += c + '\n\n'
|
122 |
|
|
|
127 |
"don't add any additional information. Make sure the answer is correct and don't output false content. "\
|
128 |
"If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
|
129 |
"search results which has nothing to do with the question. Only answer what is asked. The "\
|
130 |
+
"answer should be short and concise. \n\nQuery: {question}\nAnswer: "
|
131 |
|
132 |
prompt += f"Query: {question}\nAnswer:"
|
133 |
answer = generate_text(openAI_key, prompt,"text-davinci-003")
|