Spaces:
Runtime error
Runtime error
# app.py | |
import streamlit as st | |
import mlflow | |
import pandas as pd | |
# 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") | |
# Retrieve the list of experiments | |
experiments = mlflow.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() | |