Commit
·
5a25ed5
1
Parent(s):
3ab2a6e
updated
Browse files
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 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 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)
|
| 48 |
|
|
|
|
| 49 |
fig.update_layout(
|
| 50 |
hovermode='x unified',
|
| 51 |
xaxis_title="Launch Date",
|
| 52 |
yaxis_title="Max Output Tokens",
|
| 53 |
-
yaxis_type="log",
|
| 54 |
-
height=
|
| 55 |
showlegend=True,
|
| 56 |
legend=dict(
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
),
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
)
|
| 64 |
|
| 65 |
fig.update_traces(
|
| 66 |
-
line=dict(width=2),
|
| 67 |
-
marker=dict(size=8)
|
| 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 |
-
"
|
|
|
|
| 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 |
)
|