awacke1 commited on
Commit
3501f33
ยท
1 Parent(s): 987c77e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +66 -0
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)