Spaces:
Build error
Build error
Create app.py
Browse files
app.py
CHANGED
|
@@ -1,31 +1,64 @@
|
|
| 1 |
-
|
| 2 |
-
from
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from dotenv import load_dotenv
|
| 3 |
+
|
| 4 |
+
load_dotenv()
|
| 5 |
+
|
| 6 |
+
st.title("🤖 LLM Evaluation")
|
| 7 |
+
pages = [
|
| 8 |
+
st.Page("GenerateModelTraces.py", title="Generate Traces"),
|
| 9 |
+
st.Page("LLMasjudge.py", title="LLM as a Judge"),
|
| 10 |
+
st.Page("evaluationwithexistingdata.py", title="Evaluate with existing data"),
|
| 11 |
+
st.Page("experiments.py", title="Run Experiment"),
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
pg = st.navigation(pages)
|
| 15 |
+
pg.run()
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# action = st.radio("What would you like to do?", ["Generate Traces for Model", "Evaluate Model"])
|
| 19 |
+
# models = helpers.fetch_models()
|
| 20 |
+
# if models:
|
| 21 |
+
# if action == "Generate Traces for Model":
|
| 22 |
+
# st.subheader("Select a Model")
|
| 23 |
+
# if "selected_model" not in st.session_state:
|
| 24 |
+
# st.session_state.selected_model = models[0]
|
| 25 |
+
# st.selectbox(
|
| 26 |
+
# "Choose a model to use:",
|
| 27 |
+
# models, key = 'selected_model',
|
| 28 |
+
# index=models.index(st.session_state.selected_model) if st.session_state.selected_model in models else 0
|
| 29 |
+
# )
|
| 30 |
+
|
| 31 |
+
# if st.session_state.selected_model:
|
| 32 |
+
# st.subheader("Enter a Prompt")
|
| 33 |
+
# if "prompt" not in st.session_state:
|
| 34 |
+
# st.session_state.prompt = ""
|
| 35 |
+
# st.session_state.prompt = st.text_area("Enter your prompt:", value=st.session_state.prompt)
|
| 36 |
+
# if st.button("Generate Content", on_click=callback):
|
| 37 |
+
# if st.session_state.prompt:
|
| 38 |
+
# st.subheader("Model Output")
|
| 39 |
+
# st.session_state.generated_content = helpers.generate_content(st.session_state.selected_model, st.session_state.prompt)
|
| 40 |
+
# st.write(st.session_state.generated_content)
|
| 41 |
+
# st.session_state.spans_df = phoenix_helpers.get_spans_df()
|
| 42 |
+
# # print(spans_df)
|
| 43 |
+
# st.dataframe(st.session_state.spans_df)
|
| 44 |
+
# else:
|
| 45 |
+
# st.write("Enter something to generate content.")
|
| 46 |
+
# elif action == "Evaluate Model":
|
| 47 |
+
# st.session_state.spans_df = phoenix_helpers.get_spans_df()
|
| 48 |
+
# st.subheader("Evaluate LLM")
|
| 49 |
+
|
| 50 |
+
# if "evaluation_result" not in st.session_state:
|
| 51 |
+
# st.session_state.evaluation_result = None
|
| 52 |
+
# if (st.button("Evaluate", on_click=callback2) or st.session_state.eval_btn_clicked):
|
| 53 |
+
# if "eval_model" not in st.session_state:
|
| 54 |
+
# st.session_state.eval_model = models[0]
|
| 55 |
+
# st.selectbox(
|
| 56 |
+
# "Choose a model to use for evaluation:",
|
| 57 |
+
# models, key = 'eval_model',
|
| 58 |
+
# index=models.index(st.session_state.eval_model) if st.session_state.eval_model in models else 0,
|
| 59 |
+
# )
|
| 60 |
+
# if st.session_state.eval_model:
|
| 61 |
+
# st.session_state.evaluation_result = phoenix_helpers.evaluate_model(st.session_state.spans_df, st.session_state.eval_model)
|
| 62 |
+
# st.write(st.session_state.evaluation_result)
|
| 63 |
+
|
| 64 |
+
|