File size: 2,357 Bytes
3501f33 |
1 2 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
import streamlit as st
from graphviz import Digraph
# Define the emoji to use for the swim lanes
SWIM_LANES = {
"Data Pipelines": "๐",
"Build and Train Models": "๐งช",
"Deploy and Predict": "๐"
}
# Define the graph structure
graph = Digraph()
graph.attr(rankdir="LR")
graph.attr(fontsize="20")
graph.attr(compound="true")
# Add the swim lanes
with graph.subgraph(name="cluster_0") as c:
c.attr(color="gray")
c.attr(label=SWIM_LANES["Data Pipelines"])
c.node_attr.update(style="filled", color="white")
c.node("๐ Data Collection")
c.node("๐งน Data Cleaning")
c.node("๐ง Data Transformation")
with graph.subgraph(name="cluster_1") as c:
c.attr(color="gray")
c.attr(label=SWIM_LANES["Build and Train Models"])
c.node_attr.update(style="filled", color="white")
c.node("๐ Feature Engineering")
c.node("โ๏ธ Model Selection")
c.node("๐ Model Training")
with graph.subgraph(name="cluster_2") as c:
c.attr(color="gray")
c.attr(label=SWIM_LANES["Deploy and Predict"])
c.node_attr.update(style="filled", color="white")
c.node("๐ข Model Deployment")
c.node("๐ก Model Serving")
c.node("๐ฎ Predictions")
# Add the RLHF step
with graph.subgraph(name="cluster_3") as c:
c.attr(color="lightblue")
c.attr(label="Reinforcement Learning Human Feedback")
c.node_attr.update(style="filled", color="white")
c.node("๐ Feedback Collection")
c.node("๐ค Feedback Processing")
c.node("โ๏ธ Model Updating")
# Define the edges
graph.edge("๐ Data Collection", "๐งน Data Cleaning")
graph.edge("๐งน Data Cleaning", "๐ง Data Transformation")
graph.edge("๐ง Data Transformation", "๐ Feature Engineering")
graph.edge("๐ Feature Engineering", "โ๏ธ Model Selection")
graph.edge("โ๏ธ Model Selection", "๐ Model Training")
graph.edge("๐ Model Training", "๐ข Model Deployment")
graph.edge("๐ข Model Deployment", "๐ก Model Serving")
graph.edge("๐ก Model Serving", "๐ฎ Predictions")
graph.edge("๐ฎ Predictions", "๐ Feedback Collection")
graph.edge("๐ Feedback Collection", "๐ค Feedback Processing")
graph.edge("๐ค Feedback Processing", "โ๏ธ Model Updating")
graph.edge("โ๏ธ Model Updating", "๐ Model Training")
# Render the graph in Streamlit
st.graphviz_chart(graph.source)
|