-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext_window_chart.py
More file actions
34 lines (26 loc) · 1005 Bytes
/
Copy pathcontext_window_chart.py
File metadata and controls
34 lines (26 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import matplotlib.pyplot as plt
import numpy as np
# Data for the chart
models = ['GPT-4o', 'Claude', 'Gemini', 'Mistral']
context_windows = [128, 200, 1024, 131] # in K tokens
# Create the bar chart
plt.figure(figsize=(10, 6))
bars = plt.bar(models, context_windows, color=['#4285F4', '#34A853', '#FBBC05', '#EA4335'])
# Add labels and title
plt.xlabel('AI Model')
plt.ylabel('Context Window Size (K tokens)')
plt.title('Context Window Size Comparison Across AI Models')
# Add value labels on top of each bar
for bar in bars:
height = bar.get_height()
plt.text(bar.get_x() + bar.get_width()/2., height + 20,
f'{height}K', ha='center', va='bottom')
# Adjust y-axis to make Gemini's large value more visible
plt.ylim(0, 1200) # Set y-axis limit to accommodate labels
# Add grid lines for better readability
plt.grid(axis='y', linestyle='--', alpha=0.7)
# Save the figure
plt.tight_layout()
plt.savefig('context_window_comparison.png', dpi=300)
# Display the chart
plt.show()