IlyasMoutawwakil HF staff commited on
Commit
e3ec4e5
β€’
1 Parent(s): 8e2cf54
Files changed (1) hide show
  1. app.py +61 -63
app.py CHANGED
@@ -74,71 +74,69 @@ with demo:
74
  )
75
  gr.HTML(pretrained_fig.data)
76
 
77
- with gr.TabItem(label="Instructions Finetuend Models"):
78
- inst_finetuned_fig, ax = plt.subplots(figsize=(12, 6))
79
- ax.set_xlim(0, 100)
80
- inst_finetuned_dataset = open_llm_race_dataset[
81
- open_llm_race_dataset["type"] == ModelType.IFT.name
82
- ]
83
- inst_finetuned_dataset = inst_finetuned_dataset.pivot(
84
- index="date", columns="model", values="score"
85
- )
86
- inst_finetuned_dataset.fillna(0, inplace=True)
87
- inst_finetuned_fig = bcr.bar_chart_race(
88
- inst_finetuned_dataset,
89
- n_bars=10,
90
- fixed_max=True,
91
- period_length=1000,
92
- steps_per_period=20,
93
- end_period_pause=100,
94
- bar_texttemplate="{x:.2f}",
95
- filter_column_colors=True,
96
- fig=inst_finetuned_fig,
97
- )
98
- gr.HTML(inst_finetuned_fig.data)
99
 
100
- with gr.TabItem(label="RLHF Models"):
101
- rl_fig, ax = plt.subplots(figsize=(12, 6))
102
- ax.set_xlim(0, 100)
103
- rl_dataset = open_llm_race_dataset[
104
- open_llm_race_dataset["type"] == ModelType.IFT.name
105
- ]
106
- rl_dataset = rl_dataset.pivot(
107
- index="date", columns="model", values="score"
108
- )
109
- rl_dataset.fillna(0, inplace=True)
110
- rl_fig = bcr.bar_chart_race(
111
- rl_dataset,
112
- n_bars=10,
113
- fixed_max=True,
114
- period_length=1000,
115
- steps_per_period=20,
116
- end_period_pause=100,
117
- bar_texttemplate="{x:.2f}",
118
- filter_column_colors=True,
119
- fig=rl_fig,
120
- )
121
- gr.HTML(rl_fig.data)
122
 
123
- # with gr.TabItem(label="Finetuned Models"):
124
- # finetuned_dataset = open_llm_race_dataset[
125
- # open_llm_race_dataset["type"] == ModelType.FT.name
126
- # ]
127
- # finetuned_dataset = finetuned_dataset.pivot(
128
- # index="date", columns="model", values="score"
129
- # )
130
- # finetuned_fig = bcr.bar_chart_race(
131
- # finetuned_dataset,
132
- # n_bars=10,
133
- # fixed_max=True,
134
- # period_length=1000,
135
- # steps_per_period=20,
136
- # end_period_pause=100,
137
- # bar_texttemplate="{x:.2f}",
138
- # filter_column_colors=True,
139
- # fig=pretrained_fig,
140
- # )
141
- # gr.HTML(finetuned_fig.data)
142
 
143
 
144
  def restart_space():
 
74
  )
75
  gr.HTML(pretrained_fig.data)
76
 
77
+ with gr.TabItem(label="Instructions Finetuend Models"):
78
+ inst_finetuned_fig, ax = plt.subplots(figsize=(12, 6))
79
+ ax.set_xlim(0, 100)
80
+ inst_finetuned_dataset = open_llm_race_dataset[
81
+ open_llm_race_dataset["type"] == ModelType.IFT.name
82
+ ]
83
+ inst_finetuned_dataset = inst_finetuned_dataset.pivot(
84
+ index="date", columns="model", values="score"
85
+ )
86
+ inst_finetuned_dataset.fillna(0, inplace=True)
87
+ inst_finetuned_fig = bcr.bar_chart_race(
88
+ inst_finetuned_dataset,
89
+ n_bars=10,
90
+ fixed_max=True,
91
+ period_length=1000,
92
+ steps_per_period=20,
93
+ end_period_pause=100,
94
+ bar_texttemplate="{x:.2f}",
95
+ filter_column_colors=True,
96
+ fig=inst_finetuned_fig,
97
+ )
98
+ gr.HTML(inst_finetuned_fig.data)
99
 
100
+ with gr.TabItem(label="RLHF Models"):
101
+ rl_fig, ax = plt.subplots(figsize=(12, 6))
102
+ ax.set_xlim(0, 100)
103
+ rl_dataset = open_llm_race_dataset[
104
+ open_llm_race_dataset["type"] == ModelType.IFT.name
105
+ ]
106
+ rl_dataset = rl_dataset.pivot(index="date", columns="model", values="score")
107
+ rl_dataset.fillna(0, inplace=True)
108
+ rl_fig = bcr.bar_chart_race(
109
+ rl_dataset,
110
+ n_bars=10,
111
+ fixed_max=True,
112
+ period_length=1000,
113
+ steps_per_period=20,
114
+ end_period_pause=100,
115
+ bar_texttemplate="{x:.2f}",
116
+ filter_column_colors=True,
117
+ fig=rl_fig,
118
+ )
119
+ gr.HTML(rl_fig.data)
 
 
120
 
121
+ # with gr.TabItem(label="Finetuned Models"):
122
+ # finetuned_dataset = open_llm_race_dataset[
123
+ # open_llm_race_dataset["type"] == ModelType.FT.name
124
+ # ]
125
+ # finetuned_dataset = finetuned_dataset.pivot(
126
+ # index="date", columns="model", values="score"
127
+ # )
128
+ # finetuned_fig = bcr.bar_chart_race(
129
+ # finetuned_dataset,
130
+ # n_bars=10,
131
+ # fixed_max=True,
132
+ # period_length=1000,
133
+ # steps_per_period=20,
134
+ # end_period_pause=100,
135
+ # bar_texttemplate="{x:.2f}",
136
+ # filter_column_colors=True,
137
+ # fig=pretrained_fig,
138
+ # )
139
+ # gr.HTML(finetuned_fig.data)
140
 
141
 
142
  def restart_space():