IlyasMoutawwakil HF staff commited on
Commit
83abc20
β€’
1 Parent(s): 4b57226
Files changed (2) hide show
  1. app.py +11 -8
  2. requirements.txt +0 -1
app.py CHANGED
@@ -16,9 +16,12 @@ def restart_space():
16
  )
17
 
18
 
19
- open_llm_race_dataset = pd.read_csv(
20
- "https://huggingface.co/datasets/IlyasMoutawwakil/open-llm-race-dataset/resolve/main/open-llm-race-dataset.csv"
21
- )
 
 
 
22
 
23
 
24
  # resample for ever model to a daily frequency
@@ -63,7 +66,7 @@ def get_bar_chart(model_type: str, top_n: int = 10):
63
  filter_column_colors=True,
64
  fig=fig,
65
  )
66
- gr.HTML(fig.data)
67
 
68
 
69
  # Demo interface
@@ -73,10 +76,10 @@ with demo:
73
  gr.HTML("<center><h1>LLM Bar Race πŸ“ŠπŸƒβ€β™‚οΈ</h1></center>")
74
 
75
  with gr.Tabs():
76
- with gr.TabItem(label="Pretrained Models"):
77
- get_bar_chart(ModelType.PT.name)
78
- with gr.TabItem(label="Instructions Finetuend Models"):
79
- get_bar_chart(ModelType.IFT.name)
80
  with gr.TabItem(label="RLHF Models"):
81
  get_bar_chart(ModelType.RL.name, top_n=4)
82
 
 
16
  )
17
 
18
 
19
+ if os.path.exists("open-llm-race-dataset.csv"):
20
+ open_llm_race_dataset = pd.read_csv("open-llm-race-dataset.csv")
21
+ else:
22
+ open_llm_race_dataset = pd.read_csv(
23
+ "https://huggingface.co/datasets/IlyasMoutawwakil/open-llm-race-dataset/resolve/main/open-llm-race-dataset.csv"
24
+ )
25
 
26
 
27
  # resample for ever model to a daily frequency
 
66
  filter_column_colors=True,
67
  fig=fig,
68
  )
69
+ return gr.HTML(fig)
70
 
71
 
72
  # Demo interface
 
76
  gr.HTML("<center><h1>LLM Bar Race πŸ“ŠπŸƒβ€β™‚οΈ</h1></center>")
77
 
78
  with gr.Tabs():
79
+ # with gr.TabItem(label="Pretrained Models"):
80
+ # get_bar_chart(ModelType.PT.name)
81
+ # with gr.TabItem(label="Instructions Finetuend Models"):
82
+ # get_bar_chart(ModelType.IFT.name)
83
  with gr.TabItem(label="RLHF Models"):
84
  get_bar_chart(ModelType.RL.name, top_n=4)
85
 
requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  git+https://github.com/dexplo/bar_chart_race.git
2
  huggingface_hub
3
  APScheduler
4
- ipython
5
  pandas
6
  tqdm
 
1
  git+https://github.com/dexplo/bar_chart_race.git
2
  huggingface_hub
3
  APScheduler
 
4
  pandas
5
  tqdm