Spaces:
Runtime error
Runtime error
bhaskartripathi
commited on
Commit
•
1e4f764
1
Parent(s):
b59d9ea
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def generate_text(openAI_key, prompt, engine="text-davinci-003"):
|
|
112 |
completions = openai.Completion.create(
|
113 |
engine=engine,
|
114 |
prompt=prompt,
|
115 |
-
max_tokens=
|
116 |
n=1,
|
117 |
stop=None,
|
118 |
temperature=0.7,
|
@@ -135,8 +135,7 @@ def generate_answer(question, openAI_key):
|
|
135 |
"simply state 'Text Not Found in PDF'. Ignore outlier search results which has nothing to do with the question. "\
|
136 |
"Only answer what is asked. The answer should be short and concise. Answer step-by-step.\n\nQuery: {question}"\
|
137 |
"\nAnswer: "
|
138 |
-
|
139 |
-
|
140 |
prompt += f"Query: {question}\nAnswer:"
|
141 |
answer = generate_text(openAI_key, prompt, "text-davinci-003")
|
142 |
return answer
|
|
|
112 |
completions = openai.Completion.create(
|
113 |
engine=engine,
|
114 |
prompt=prompt,
|
115 |
+
max_tokens=4096,
|
116 |
n=1,
|
117 |
stop=None,
|
118 |
temperature=0.7,
|
|
|
135 |
"simply state 'Text Not Found in PDF'. Ignore outlier search results which has nothing to do with the question. "\
|
136 |
"Only answer what is asked. The answer should be short and concise. Answer step-by-step.\n\nQuery: {question}"\
|
137 |
"\nAnswer: "
|
138 |
+
|
|
|
139 |
prompt += f"Query: {question}\nAnswer:"
|
140 |
answer = generate_text(openAI_key, prompt, "text-davinci-003")
|
141 |
return answer
|