Update app.py
Browse files
app.py
CHANGED
@@ -177,7 +177,8 @@ if ask:
|
|
177 |
api_key_ = openai_api_key
|
178 |
st.write(f"**{BOOK_NAME}:** got {dice}, lucky you!")
|
179 |
|
180 |
-
openai.api_key = api_key_
|
|
|
181 |
if not api_key_:
|
182 |
st.write(f"**{BOOK_NAME}:** got {dice}, no luck, try again?")
|
183 |
st.stop()
|
@@ -192,7 +193,6 @@ if ask:
|
|
192 |
# ns.counter = 1
|
193 |
|
194 |
with st.spinner(msg):
|
195 |
-
os.environ["OPENAI_API_KEY"] = openai_api_key
|
196 |
try:
|
197 |
answer, pages, extract = get_answer(question=user_input)
|
198 |
logger.info(f"answer: {answer}")
|
|
|
177 |
api_key_ = openai_api_key
|
178 |
st.write(f"**{BOOK_NAME}:** got {dice}, lucky you!")
|
179 |
|
180 |
+
# openai.api_key = api_key_
|
181 |
+
os.environ["OPENAI_API_KEY"] = api_key_
|
182 |
if not api_key_:
|
183 |
st.write(f"**{BOOK_NAME}:** got {dice}, no luck, try again?")
|
184 |
st.stop()
|
|
|
193 |
# ns.counter = 1
|
194 |
|
195 |
with st.spinner(msg):
|
|
|
196 |
try:
|
197 |
answer, pages, extract = get_answer(question=user_input)
|
198 |
logger.info(f"answer: {answer}")
|