Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,19 @@ import hashlib
|
|
22 |
|
23 |
|
24 |
load_dotenv()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
def setup_api_clients():
|
|
|
|
|
27 |
with st.sidebar:
|
28 |
st.title("API Configuration")
|
29 |
|
@@ -220,19 +231,14 @@ def process_evaluations_concurrently(questions, prompt_template, models_to_evalu
|
|
220 |
return results
|
221 |
|
222 |
def main():
|
223 |
-
st.set_page_config(page_title="LLM Benchmarking
|
224 |
-
|
225 |
-
if 'api_configured' not in st.session_state:
|
226 |
-
st.session_state.api_configured = False
|
227 |
|
|
|
228 |
setup_api_clients()
|
229 |
|
230 |
-
st.title("LLM Benchmarking in Healthcare")
|
231 |
-
|
232 |
if not st.session_state.api_configured:
|
233 |
st.warning("Please configure API keys in the sidebar to proceed")
|
234 |
st.stop()
|
235 |
-
|
236 |
|
237 |
if 'all_results' not in st.session_state:
|
238 |
st.session_state.all_results = {}
|
|
|
22 |
|
23 |
|
24 |
load_dotenv()
|
25 |
+
def initialize_session_state():
|
26 |
+
if 'api_configured' not in st.session_state:
|
27 |
+
st.session_state.api_configured = False
|
28 |
+
if 'togetherai_client' not in st.session_state:
|
29 |
+
st.session_state.togetherai_client = None
|
30 |
+
if 'openai_client' not in st.session_state:
|
31 |
+
st.session_state.openai_client = None
|
32 |
+
if 'anthropic_client' not in st.session_state:
|
33 |
+
st.session_state.anthropic_client = None
|
34 |
|
35 |
def setup_api_clients():
|
36 |
+
initialize_session_state()
|
37 |
+
|
38 |
with st.sidebar:
|
39 |
st.title("API Configuration")
|
40 |
|
|
|
231 |
return results
|
232 |
|
233 |
def main():
|
234 |
+
st.set_page_config(page_title="LLM Healthcare Benchmarking", layout="wide")
|
|
|
|
|
|
|
235 |
|
236 |
+
initialize_session_state()
|
237 |
setup_api_clients()
|
238 |
|
|
|
|
|
239 |
if not st.session_state.api_configured:
|
240 |
st.warning("Please configure API keys in the sidebar to proceed")
|
241 |
st.stop()
|
|
|
242 |
|
243 |
if 'all_results' not in st.session_state:
|
244 |
st.session_state.all_results = {}
|