awacke1's picture
Create app.py
3501f33
raw
history blame
2.36 kB
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)