nazneen commited on
Commit
7fec6b3
1 Parent(s): 8b3504c

plot details

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -24,6 +24,10 @@ if __name__ == "__main__":
24
  st.set_page_config(layout="wide", page_title="HF Hub Model Usage Visualization")
25
 
26
  st.header("Model Usage Visualization")
 
 
 
 
27
 
28
  popularity = st.radio("Model popularity", ('Low', 'Moderate', 'High'), key = "popularity", index=2, horizontal = True)
29
 
@@ -39,7 +43,7 @@ if __name__ == "__main__":
39
  df_plot_2021 = df_plot[df_plot.columns[(df_plot.mean(axis=0)<=40000) & (df_plot.mean(axis=0)>=5000)]]
40
  else:
41
  df_plot_2021 = df_plot[df_plot.columns[df_plot.mean(axis=0)>=40000]]
42
- fig = px.line(df_plot_2021, title="Model created in 2021", labels={"index": "Weeks", "value": "Usage", "variable": "Model"})
43
  st.plotly_chart(fig, use_container_width=True)
44
 
45
  with st.container():
@@ -54,7 +58,7 @@ if __name__ == "__main__":
54
  df_plot_2022 = df_plot[df_plot.columns[(df_plot.mean(axis=0)<=1500) & (df_plot.mean(axis=0)>=500)]]
55
  else:
56
  df_plot_2022 = df_plot[df_plot.columns[df_plot.mean(axis=0)>=1500]]
57
- fig = px.line(df_plot_2022, title="Model created in 2022", labels={"index": "Weeks", "value": "Usage", "variable": "Model"})
58
  st.plotly_chart(fig, use_container_width=True)
59
 
60
 
 
24
  st.set_page_config(layout="wide", page_title="HF Hub Model Usage Visualization")
25
 
26
  st.header("Model Usage Visualization")
27
+ with st.expander("How to read and interact with the plot:"):
28
+ st.markdown("The plots below visualize model usage for HF models created in mid 2021 (top) vs. models created in mid 2022 (bottom). Note the y-axis range is different for each plot.")
29
+ st.markdown("The plots are categorized based on model popularity. I first created a histogram of weekly mean usage across all models and then grouped them into these categorizes so that the plots are easier to read.")
30
+ st.markdown("The plots are interactive. Hover over the points to see the model name and the number of weekly mean usage. Click on the legend to hide/show the models.")
31
 
32
  popularity = st.radio("Model popularity", ('Low', 'Moderate', 'High'), key = "popularity", index=2, horizontal = True)
33
 
 
43
  df_plot_2021 = df_plot[df_plot.columns[(df_plot.mean(axis=0)<=40000) & (df_plot.mean(axis=0)>=5000)]]
44
  else:
45
  df_plot_2021 = df_plot[df_plot.columns[df_plot.mean(axis=0)>=40000]]
46
+ fig = px.line(df_plot_2021, title="Models created in 2021", labels={"index": "Weeks", "value": "Usage", "variable": "Model"})
47
  st.plotly_chart(fig, use_container_width=True)
48
 
49
  with st.container():
 
58
  df_plot_2022 = df_plot[df_plot.columns[(df_plot.mean(axis=0)<=1500) & (df_plot.mean(axis=0)>=500)]]
59
  else:
60
  df_plot_2022 = df_plot[df_plot.columns[df_plot.mean(axis=0)>=1500]]
61
+ fig = px.line(df_plot_2022, title="Models created in 2022", labels={"index": "Weeks", "value": "Usage", "variable": "Model"})
62
  st.plotly_chart(fig, use_container_width=True)
63
 
64