Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Sep 18, 2024
1 parent bfa4080 commit eec10f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"filename": "alphastats/gui/utils/ollama_utils.py",
"hashed_secret": "8ed4322e8e2790b8c928d381ce8d07cfd966e909",
"is_verified": false,
"line_number": 68,
"line_number": 69,
"is_secret": false
}
],
Expand All @@ -160,5 +160,5 @@
}
]
},
"generated_at": "2024-09-12T14:19:09Z"
"generated_at": "2024-09-18T07:09:01Z"
}
3 changes: 1 addition & 2 deletions alphastats/gui/pages/05_LLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def select_analysis():
index=0 if st.session_state["api_type"] == "gpt4o" else 1,
)
base_url = "http://localhost:11434/v1"
api_key=None
api_key = None
if st.session_state["api_type"] == "gpt4o":
api_key = st.text_input("Enter OpenAI API Key", type="password")
set_api_key(api_key)
Expand All @@ -108,7 +108,6 @@ def select_analysis():
c1, c2 = st.columns((1, 2))

with c1:

st.markdown("#### Analysis")
method = select_analysis()
chosen_parameter_dict = helper_compare_two_groups()
Expand Down
7 changes: 2 additions & 5 deletions alphastats/gui/utils/openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,8 @@ def set_api_key(api_key: str = None) -> None:
"`openai_api_key = <key>`"
)
except KeyError:
st.write(
"OpenAI API key not found in secrets."
)
st.write("OpenAI API key not found in secrets.")
except Exception as e:
st.write(
f"Error loading OpenAI API key: {e}.")
st.write(f"Error loading OpenAI API key: {e}.")

openai.OpenAI.api_key = api_key

0 comments on commit eec10f0

Please sign in to comment.