harmdevries commited on
Commit
17d61e7
1 Parent(s): df8c933

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -72
app.py CHANGED
@@ -8,79 +8,76 @@ import math
8
  import copy
9
 
10
  st.set_page_config(layout="wide")
11
- name2repo = [("Inference", "bigcode-project/bigcode-inference-benchmark")]
 
 
12
 
13
  g = Github(os.environ.get('github'))
14
 
15
- inference_repo = g.get_repo("bigcode-project/bigcode-inference-benchmark")
16
- df = list()
17
- all_status = list()
18
- for milestone in inference_repo.get_milestones():
19
- desc = dict()
20
- for line in milestone.description.split('\n'):
21
- tmp = line.split(":")
22
- desc[tmp[0].lower()] = tmp[1].lower().strip()
23
- task_name = f"""<a href="https://www.github.com/bigcode-project/bigcode-inference-benchmark/milestone/{milestone.number}", target="_black">{milestone.title}</a>"""
24
- if desc['status'] not in all_status:
25
- all_status.append(desc['status'])
26
- df.append(dict(Task=task_name,
27
- Start=desc['start date'],
28
- Finish=milestone.due_on.strftime('%Y-%m-%d'),
29
- Resource=desc['status'],
30
- Description=desc['leader']))
31
-
32
- df.append(dict(Task=f"""<a href="https://www.github.com/bigcode-project/bigcode-inference-benchmark/milestone/1", target="_black">PII data collection</a>""",
33
- Start='2023-04-02',
34
- Finish='2023-04-02',
35
- Resource='in progress'))
36
-
37
- colors = {'not started': 'rgb(217, 217, 217)',
38
- 'in progress': 'rgb(147, 196, 125)',
39
- 'high priority - on track': 'rgb(234, 153, 153)',
40
- 'high priority - help needed': 'rgb(255, 0, 0)',
41
- 'completed': 'rgb(56, 118, 29)'}
42
-
43
- for key in colors.keys():
44
- if key not in all_status:
45
  df.append(dict(Task=task_name,
46
- Start='2023-04-02',
47
- Finish='2023-04-02',
48
- Resource=key))
49
-
50
- fig = ff.create_gantt(df, colors=colors,
51
- index_col='Resource',
52
- show_colorbar=True,
53
- show_hover_fill=True,
54
- group_tasks=True,
55
- title="Inference")
56
-
57
- fig.update_xaxes(ticks= "outside",
58
- ticklabelmode= "period",
59
- tickformat="%b",
60
- tickcolor= "black",
61
- ticklen=10,
62
- range=[datetime.datetime(2022, 12, 30),
63
- datetime.datetime(2023, 4, 2)],
64
- minor=dict(
65
- ticklen=4,
66
- dtick=7*24*60*60*1000,
67
- tick0="2023-01-01",
68
- griddash='dot',
69
- gridcolor='white')
70
- )
71
-
72
- fig.update_yaxes(automargin=True) # fix margins
73
- fig.layout.xaxis.rangeselector = None # remove range selector on top
74
-
75
- fig.add_vline(x=datetime.datetime.now().strftime('%Y-%m-%d'), line_width=3, line_dash="dash", line_color="black")
76
- fig.add_annotation({
77
- "x": datetime.datetime.now().strftime('%Y-%m-%d'),
78
- "y": fig.layout.yaxis['range'][1],
79
- "yshift": 10,
80
- "text": "Today",
81
- "align": "left",
82
- "showarrow": False,
83
- })
84
-
85
- # fig.data.append(tmp)
86
- st.plotly_chart(fig, use_container_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  import copy
9
 
10
  st.set_page_config(layout="wide")
11
+ name2repo = [("Training", "bigcode-project/Megatron-LM"),
12
+ ("Inference", "bigcode-project/bigcode-inference-benchmark"),
13
+ ]
14
 
15
  g = Github(os.environ.get('github'))
16
 
17
+ for name, repo_name in name2repo:
18
+ repo = g.get_repo(repo_name)
19
+ df = list()
20
+ all_status = list()
21
+ for milestone in inference_repo.get_milestones():
22
+ desc = dict()
23
+ for line in milestone.description.split('\n'):
24
+ tmp = line.split(":")
25
+ desc[tmp[0].lower()] = tmp[1].lower().strip()
26
+ task_name = f"""<a href="https://www.github.com/{repo_name}/milestone/{milestone.number}", target="_black">{milestone.title}</a>"""
27
+ if desc['status'] not in all_status:
28
+ all_status.append(desc['status'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  df.append(dict(Task=task_name,
30
+ Start=desc['start date'],
31
+ Finish=milestone.due_on.strftime('%Y-%m-%d'),
32
+ Resource=desc['status'],
33
+ Description=desc['leader']))
34
+
35
+ colors = {'not started': 'rgb(217, 217, 217)',
36
+ 'in progress': 'rgb(147, 196, 125)',
37
+ 'high priority - on track': 'rgb(234, 153, 153)',
38
+ 'high priority - help needed': 'rgb(255, 0, 0)',
39
+ 'completed': 'rgb(56, 118, 29)'}
40
+
41
+ for key in colors.keys():
42
+ if key not in all_status:
43
+ df.append(dict(Task=task_name,
44
+ Start='2023-04-02',
45
+ Finish='2023-04-02',
46
+ Resource=key))
47
+
48
+ fig = ff.create_gantt(df, colors=colors,
49
+ index_col='Resource',
50
+ show_colorbar=True,
51
+ show_hover_fill=True,
52
+ group_tasks=True,
53
+ title=name)
54
+
55
+ fig.update_xaxes(ticks= "outside",
56
+ ticklabelmode= "period",
57
+ tickformat="%b",
58
+ tickcolor= "black",
59
+ ticklen=10,
60
+ range=[datetime.datetime(2022, 12, 30),
61
+ datetime.datetime(2023, 4, 2)],
62
+ minor=dict(
63
+ ticklen=4,
64
+ dtick=7*24*60*60*1000,
65
+ tick0="2023-01-01",
66
+ griddash='dot',
67
+ gridcolor='white')
68
+ )
69
+
70
+ fig.update_yaxes(automargin=True) # fix margins
71
+ fig.layout.xaxis.rangeselector = None # remove range selector on top
72
+
73
+ fig.add_vline(x=datetime.datetime.now().strftime('%Y-%m-%d'), line_width=3, line_dash="dash", line_color="black")
74
+ fig.add_annotation({
75
+ "x": datetime.datetime.now().strftime('%Y-%m-%d'),
76
+ "y": fig.layout.yaxis['range'][1],
77
+ "yshift": 10,
78
+ "text": "Today",
79
+ "align": "left",
80
+ "showarrow": False,
81
+ })
82
+
83
+ st.plotly_chart(fig, use_container_width=True)