Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from graphviz import Digraph
|
3 |
+
|
4 |
+
# Define the emoji to use for the swim lanes
|
5 |
+
SWIM_LANES = {
|
6 |
+
"Data Pipelines": "๐",
|
7 |
+
"Build and Train Models": "๐งช",
|
8 |
+
"Deploy and Predict": "๐"
|
9 |
+
}
|
10 |
+
|
11 |
+
# Define the graph structure
|
12 |
+
graph = Digraph()
|
13 |
+
graph.attr(rankdir="LR")
|
14 |
+
graph.attr(fontsize="20")
|
15 |
+
graph.attr(compound="true")
|
16 |
+
|
17 |
+
# Add the swim lanes
|
18 |
+
with graph.subgraph(name="cluster_0") as c:
|
19 |
+
c.attr(color="gray")
|
20 |
+
c.attr(label=SWIM_LANES["Data Pipelines"])
|
21 |
+
c.node_attr.update(style="filled", color="white")
|
22 |
+
c.node("๐ Data Collection")
|
23 |
+
c.node("๐งน Data Cleaning")
|
24 |
+
c.node("๐ง Data Transformation")
|
25 |
+
|
26 |
+
with graph.subgraph(name="cluster_1") as c:
|
27 |
+
c.attr(color="gray")
|
28 |
+
c.attr(label=SWIM_LANES["Build and Train Models"])
|
29 |
+
c.node_attr.update(style="filled", color="white")
|
30 |
+
c.node("๐ Feature Engineering")
|
31 |
+
c.node("โ๏ธ Model Selection")
|
32 |
+
c.node("๐ Model Training")
|
33 |
+
|
34 |
+
with graph.subgraph(name="cluster_2") as c:
|
35 |
+
c.attr(color="gray")
|
36 |
+
c.attr(label=SWIM_LANES["Deploy and Predict"])
|
37 |
+
c.node_attr.update(style="filled", color="white")
|
38 |
+
c.node("๐ข Model Deployment")
|
39 |
+
c.node("๐ก Model Serving")
|
40 |
+
c.node("๐ฎ Predictions")
|
41 |
+
|
42 |
+
# Add the RLHF step
|
43 |
+
with graph.subgraph(name="cluster_3") as c:
|
44 |
+
c.attr(color="lightblue")
|
45 |
+
c.attr(label="Reinforcement Learning Human Feedback")
|
46 |
+
c.node_attr.update(style="filled", color="white")
|
47 |
+
c.node("๐ Feedback Collection")
|
48 |
+
c.node("๐ค Feedback Processing")
|
49 |
+
c.node("โ๏ธ Model Updating")
|
50 |
+
|
51 |
+
# Define the edges
|
52 |
+
graph.edge("๐ Data Collection", "๐งน Data Cleaning")
|
53 |
+
graph.edge("๐งน Data Cleaning", "๐ง Data Transformation")
|
54 |
+
graph.edge("๐ง Data Transformation", "๐ Feature Engineering")
|
55 |
+
graph.edge("๐ Feature Engineering", "โ๏ธ Model Selection")
|
56 |
+
graph.edge("โ๏ธ Model Selection", "๐ Model Training")
|
57 |
+
graph.edge("๐ Model Training", "๐ข Model Deployment")
|
58 |
+
graph.edge("๐ข Model Deployment", "๐ก Model Serving")
|
59 |
+
graph.edge("๐ก Model Serving", "๐ฎ Predictions")
|
60 |
+
graph.edge("๐ฎ Predictions", "๐ Feedback Collection")
|
61 |
+
graph.edge("๐ Feedback Collection", "๐ค Feedback Processing")
|
62 |
+
graph.edge("๐ค Feedback Processing", "โ๏ธ Model Updating")
|
63 |
+
graph.edge("โ๏ธ Model Updating", "๐ Model Training")
|
64 |
+
|
65 |
+
# Render the graph in Streamlit
|
66 |
+
st.graphviz_chart(graph.source)
|