Spaces:
Runtime error
Runtime error
rlancemartin
commited on
Commit
•
2a79a0c
1
Parent(s):
6032b6e
Set API keys
Browse files
app.py
CHANGED
@@ -338,9 +338,6 @@ st.sidebar.image("img/diagnostic.jpg")
|
|
338 |
oai_api_key = st.sidebar.text_input("`OpenAI API Key:`", type="password")
|
339 |
ant_api_key = st.sidebar.text_input("`(Optional) Anthropic API Key:`", type="password")
|
340 |
hf_api_key = st.sidebar.text_input("`(Optional) HuggingFace API Token:`", type="password")
|
341 |
-
os.environ["OPENAI_API_KEY"] = oai_api_key
|
342 |
-
os.environ["ANTHROPIC_API_KEY"] = ant_api_key
|
343 |
-
os.environ["HUGGINGFACEHUB_API_TOKEN"] = hf_api_key
|
344 |
|
345 |
with st.sidebar.form("user_input"):
|
346 |
|
@@ -412,6 +409,10 @@ with st.form(key='file_inputs'):
|
|
412 |
|
413 |
if uploaded_file and oai_api_key:
|
414 |
|
|
|
|
|
|
|
|
|
415 |
# Load docs
|
416 |
text = load_docs(uploaded_file)
|
417 |
# Generate num_eval_questions questions, each from context of 3k chars randomly selected
|
|
|
338 |
oai_api_key = st.sidebar.text_input("`OpenAI API Key:`", type="password")
|
339 |
ant_api_key = st.sidebar.text_input("`(Optional) Anthropic API Key:`", type="password")
|
340 |
hf_api_key = st.sidebar.text_input("`(Optional) HuggingFace API Token:`", type="password")
|
|
|
|
|
|
|
341 |
|
342 |
with st.sidebar.form("user_input"):
|
343 |
|
|
|
409 |
|
410 |
if uploaded_file and oai_api_key:
|
411 |
|
412 |
+
os.environ["OPENAI_API_KEY"] = oai_api_key
|
413 |
+
os.environ["ANTHROPIC_API_KEY"] = ant_api_key
|
414 |
+
os.environ["HUGGINGFACEHUB_API_TOKEN"] = hf_api_key
|
415 |
+
|
416 |
# Load docs
|
417 |
text = load_docs(uploaded_file)
|
418 |
# Generate num_eval_questions questions, each from context of 3k chars randomly selected
|