dperales's picture
Update app.py
e0787af
raw
history blame
1.08 kB
# app.py
import streamlit as st
import mlflow
import pandas as pd
from mlflow.tracking import MlflowClient
# Set the MLflow tracking URI (e.g., local file system or a remote server)
mlflow.set_tracking_uri("http://localhost:5000")
def main():
st.title("Streamlit and MLflow Integration")
# Create an MlflowClient instance
client = MlflowClient()
# Retrieve the list of experiments
experiments = client.list_experiments()
experiment_names = [exp.name for exp in experiments]
experiment_id_map = {exp.name: exp.experiment_id for exp in experiments}
# Create a dropdown menu to select an experiment
selected_experiment = st.selectbox("Select an experiment:", experiment_names)
# Get the runs for the selected experiment
if selected_experiment:
experiment_id = experiment_id_map[selected_experiment]
runs = mlflow.search_runs(experiment_ids=[experiment_id])
# Display the runs in a table
st.write("Runs for the selected experiment:")
st.write(runs)
if __name__ == "__main__":
main()