danielrosehill commited on
Commit
5a25ed5
·
1 Parent(s): 3ab2a6e
Files changed (1) hide show
  1. app.py +59 -21
app.py CHANGED
@@ -8,6 +8,19 @@ st.set_page_config(
8
  layout="wide"
9
  )
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # Load data
12
  @st.cache_data
13
  def load_data():
@@ -20,14 +33,16 @@ df = load_data()
20
  # Title
21
  st.title("LLM Max Output Tokens Analysis")
22
 
23
- # Company selection
24
- companies = sorted(df['company'].unique())
25
- selected_companies = st.multiselect(
26
- "Select companies to display:",
27
- options=companies,
28
- default=companies,
29
- key='company_filter'
30
- )
 
 
31
 
32
  # Filter data based on selection
33
  filtered_df = df[df['company'].isin(selected_companies)]
@@ -44,27 +59,47 @@ fig = px.line(filtered_df,
44
  'max_output_tokens': 'Max Output Tokens',
45
  'company': 'Company'
46
  },
47
- markers=True) # Add markers to make trends clearer
48
 
 
49
  fig.update_layout(
50
  hovermode='x unified',
51
  xaxis_title="Launch Date",
52
  yaxis_title="Max Output Tokens",
53
- yaxis_type="log", # Using log scale for better visualization
54
- height=600, # Make chart taller
55
  showlegend=True,
56
  legend=dict(
57
- yanchor="top",
58
- y=0.99,
59
- xanchor="left",
60
- x=0.01
 
 
 
 
 
 
61
  ),
62
- margin=dict(l=20, r=20, t=40, b=20)
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  )
64
 
65
  fig.update_traces(
66
- line=dict(width=2), # Make lines thicker
67
- marker=dict(size=8) # Make markers more visible
68
  )
69
 
70
  # Display the chart
@@ -96,9 +131,12 @@ st.dataframe(
96
  hide_index=True
97
  )
98
 
99
- # Attribution
100
- st.markdown("---")
101
  st.markdown(
102
- "By: [Daniel Rosehill](https://danielrosehill.com) | "
 
103
  "Data sourced from public sources on February 8, 2025"
 
 
104
  )
 
8
  layout="wide"
9
  )
10
 
11
+ # Custom CSS
12
+ st.markdown("""
13
+ <style>
14
+ .stMultiSelect {
15
+ max-width: 800px;
16
+ }
17
+ .main > div {
18
+ padding-left: 1rem;
19
+ padding-right: 1rem;
20
+ }
21
+ </style>
22
+ """, unsafe_allow_html=True)
23
+
24
  # Load data
25
  @st.cache_data
26
  def load_data():
 
33
  # Title
34
  st.title("LLM Max Output Tokens Analysis")
35
 
36
+ # Company selection in a more compact layout
37
+ col1, col2 = st.columns([2, 1])
38
+ with col1:
39
+ companies = sorted(df['company'].unique())
40
+ selected_companies = st.multiselect(
41
+ "Select companies to display:",
42
+ options=companies,
43
+ default=companies,
44
+ key='company_filter'
45
+ )
46
 
47
  # Filter data based on selection
48
  filtered_df = df[df['company'].isin(selected_companies)]
 
59
  'max_output_tokens': 'Max Output Tokens',
60
  'company': 'Company'
61
  },
62
+ markers=True)
63
 
64
+ # Improved chart layout
65
  fig.update_layout(
66
  hovermode='x unified',
67
  xaxis_title="Launch Date",
68
  yaxis_title="Max Output Tokens",
69
+ yaxis_type="log",
70
+ height=500,
71
  showlegend=True,
72
  legend=dict(
73
+ orientation="h",
74
+ yanchor="bottom",
75
+ y=1.02,
76
+ xanchor="right",
77
+ x=1
78
+ ),
79
+ margin=dict(l=40, r=40, t=60, b=40),
80
+ yaxis=dict(
81
+ tickformat=",",
82
+ dtick=0.30102999566, # log10(2) for better log scale ticks
83
  ),
84
+ plot_bgcolor='white',
85
+ paper_bgcolor='white',
86
+ )
87
+
88
+ # Improved grid and traces
89
+ fig.update_xaxes(
90
+ gridcolor='lightgray',
91
+ gridwidth=0.5,
92
+ showgrid=True
93
+ )
94
+ fig.update_yaxes(
95
+ gridcolor='lightgray',
96
+ gridwidth=0.5,
97
+ showgrid=True
98
  )
99
 
100
  fig.update_traces(
101
+ line=dict(width=2),
102
+ marker=dict(size=8)
103
  )
104
 
105
  # Display the chart
 
131
  hide_index=True
132
  )
133
 
134
+ # Attribution with better spacing
135
+ st.markdown("<br>", unsafe_allow_html=True)
136
  st.markdown(
137
+ "<div style='border-top: 1px solid #ccc; padding-top: 1rem; color: #666;'>"
138
+ "By: <a href='https://danielrosehill.com' style='color: #666;'>Daniel Rosehill</a> | "
139
  "Data sourced from public sources on February 8, 2025"
140
+ "</div>",
141
+ unsafe_allow_html=True
142
  )