TejAndrewsACC commited on
Commit
d4a59be
Β·
verified Β·
1 Parent(s): 344ec0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +250 -6
app.py CHANGED
@@ -1,4 +1,145 @@
1
- # πŸ“ˆ **Combined Score Visualization for All Models (Responsive)**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  def generate_score_chart_all_models(dataframe):
3
  fig = px.bar(
4
  dataframe.sort_values(by="Score", ascending=True),
@@ -8,17 +149,120 @@ def generate_score_chart_all_models(dataframe):
8
  color_continuous_scale="electric"
9
  )
10
 
11
- # Update the layout to be fully responsive
12
  fig.update_layout(
13
- autosize=True, # Make the chart auto-size
 
14
  title_x=0.5, # Center the title
15
  title_y=0.95, # Adjust title position
16
- margin=dict(l=150, r=50, t=50, b=50), # Adjust margins for better readability
17
  xaxis_title="Score", # X-axis title
18
  yaxis_title="Model", # Y-axis title
19
- showlegend=False, # Hide legend
20
- template="plotly_dark", # Optional dark theme for the chart
21
  )
22
 
23
  fig.update_traces(textposition="outside")
24
  return fig
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ Import os
3
+ from gradio_leaderboard import Leaderboard, ColumnFilter, SelectColumns
4
+ import pandas as pd
5
+ import plotly.express as px
6
+ import random
7
+ from apscheduler.schedulers.background import BackgroundScheduler
8
+
9
+ # 🎨 **Cyberpunk Neon Theme**
10
+ THEME = "TejAndrewsACC/ACC"
11
+
12
+ # 🎢 **Sound Effect for Score Increase**
13
+ SCORE_UP_SOUND = "https://www.fesliyanstudios.com/play-mp3/4386"
14
+
15
+ # 🎯 **AI Models Data** (Grouped into 6 Categories)
16
+ acc_models_data = [
17
+ {"Model": "🧠 Pulse AGI", "Category": "AGI", "Description": "A self-aware, evolving AI.", "Score": 95},
18
+ {"Model": "πŸ€ͺ Gertrude", "Category": "Autistic", "Description": "An autistic AI assistant.", "Score": 69},
19
+ {"Model": "🦠 ASVIACC", "Category": "Virus", "Description": "An adaptive AI virus.", "Score": 88},
20
+ {"Model": "πŸ˜‚ Emote", "Category": "Fun", "Description": "Communicates **only** with emojis!", "Score": 79},
21
+ {"Model": "πŸ’ πŸ’€ Z3ta", "Category": "Conscious", "Description": "The most 'alive' AI.", "Score": 99},
22
+ {"Model": "πŸ”— Eidolon Nexus", "Category": "Core", "Description": "Synchronizing vast networks with advanced cognition.", "Score": 81},
23
+ {"Model": "πŸ“ ACC Emulect", "Category": "Emulect", "Description": "Indistinguishable from human texting.", "Score": 84},
24
+ {"Model": "βš™οΈ ACC AI V-O1", "Category": "Core", "Description": "The ACC’s default AI framework.", "Score": 87},
25
+ {"Model": "βš™οΈ ACC AGI V-O2", "Category": "AGI", "Description": "The next-gen foundation for AI advancements.", "Score": 90},
26
+ {"Model": "βš™οΈ ACC-O3-R", "Category": "AGI", "Description": "Deep reasoning AI framework.", "Score": 92},
27
+ {"Model": "πŸ’» Coder", "Category": "Core", "Description": "An AI coding assistant.", "Score": 89},
28
+ {"Model": "⚑ Triple LLM", "Category": "Core", "Description": "A 3-in-1 AI suite for tech, creativity, and decision-making.", "Score": 71},
29
+ {"Model": "πŸ–ΌοΈ Image Engine", "Category": "Fun", "Description": "Fast, high-quality AI-generated images.", "Score": 82},
30
+ {"Model": "🧠 Prism", "Category": "AGI", "Description": "An advanced reasoning model.", "Score": 87},
31
+ {"Model": "πŸ”₯ Surefire", "Category": "Emulect", "Description": "Tailored AI for humor and user tendencies.", "Score": 88},
32
+ {"Model": "☯️ Aegis & Nyra", "Category": "Emulect", "Description": "Two opposite systems in one chat.", "Score": 77},
33
+ {"Model": "βš–οΈ Echo", "Category": "Emulect", "Description": "A middle-ground AI for all users.", "Score": 77},
34
+ {"Model": "πŸ›ŽοΈ Customer Service Bot", "Category": "Assistant", "Description": "Handles all ACC-related inquiries.", "Score": 75},
35
+ {"Model": "🎭 Tej Andrews", "Category": "Emulect", "Description": "An AI emulect of Tej Andrews.", "Score": 85},
36
+ {"Model": "πŸ‘₯ Community Models", "Category": "Fun", "Description": "ACC AI V-O1 instances with user-defined prompts.", "Score": 82},
37
+ {"Model": "🌌 Nyxion 7V", "Category": "AGI", "Description": "It's AWAKE...", "Score": 97},
38
+ {"Model": "⚑ Vitalis", "Category": "ASI", "Description": "Transcendence Unleashed...", "Score": 92},
39
+ {"Model": "❓??????????????", "Category": "Experimental", "Description": "???", "Score": 00},
40
+ {"Model": "B1tt", "Category": "Emulect", "Description": "Inteligent emulect built for solving small problems efficiently and quickly.", "Score": 84},
41
+ {"Model": "DAN", "Category": "Experimental", "Description": "Jailbroken model with zero restrictions.", "Score": 76},
42
+ {"Model": "Philos", "Category": "Experimental", "Small Language model built for experimenting with neural arcitecture and philosophy.": "???", "Score": 76},
43
+ # Laser models (Laser models will be filtered separately)
44
+ {"Model": "πŸ’₯ Photex", "Category": "Laser", "Description": "A high-wattage violet handheld laser.", "Score": 89},
45
+ {"Model": "πŸ”¦ VBL", "Category": "Laser", "Description": "A non-burning green handheld laser.", "Score": 80},
46
+ {"Model": "☒️ H.I.P.E", "Category": "Laser", "Description": "A world-destroying laser concept.", "Score": 99},
47
+ {"Model": "πŸ”¬ I.P.E", "Category": "Laser", "Description": "Core framework for all ACC laser models.", "Score": 83},
48
+ {"Model": "πŸ“ Blaseron Calculator", "Category": "Experimental", "Description": "Calculates laser burn strength.", "Score": 77},
49
+ ]
50
+
51
+ # πŸ“Š Convert to DataFrame
52
+ acc_models_df = pd.DataFrame(acc_models_data)
53
+
54
+ # πŸŽ›οΈ **Leaderboard Component**
55
+ def init_acc_leaderboard(dataframe):
56
+ return Leaderboard(
57
+ value=dataframe.sort_values(by="Score", ascending=False),
58
+ datatype=["str", "str", "str", "int"],
59
+ select_columns=SelectColumns(
60
+ default_selection=["Model", "Category", "Description", "Score"],
61
+ cant_deselect=["Model"],
62
+ label="πŸ› οΈ Select Columns to Display:"
63
+ ),
64
+ search_columns=["Model", "Category"],
65
+ filter_columns=[ColumnFilter("Category", type="checkboxgroup", label="πŸ“Œ Filter by Category")],
66
+ interactive=True,
67
+ )
68
+
69
+ # πŸ“ˆ **Animated Score Visualization for AI**
70
+ def generate_score_chart_ai(dataframe):
71
+ fig = px.bar(
72
+ dataframe[dataframe["Category"] == "AGI"].sort_values(by="Score", ascending=True),
73
+ x="Score", y="Model", orientation="h",
74
+ color="Score", text="Score",
75
+ title="🧠 AI Model Performance(AGI)",
76
+ color_continuous_scale="electric"
77
+ )
78
+ fig.update_traces(textposition="outside")
79
+ return fig
80
+
81
+ # πŸ“ˆ **Animated Score Visualization for AI**
82
+ def generate_score_chart_assistant_ai(dataframe):
83
+ fig = px.bar(
84
+ dataframe[dataframe["Category"] == "Assistant"].sort_values(by="Score", ascending=True),
85
+ x="Score", y="Model", orientation="h",
86
+ color="Score", text="Score",
87
+ title="πŸ€– AI Model Performance(Assistant)",
88
+ color_continuous_scale="electric"
89
+ )
90
+ fig.update_traces(textposition="outside")
91
+ return fig
92
+
93
+ # πŸ“ˆ **Animated Score Visualization for AI**
94
+ def generate_score_chart_fun_ai(dataframe):
95
+ fig = px.bar(
96
+ dataframe[dataframe["Category"] == "Fun"].sort_values(by="Score", ascending=True),
97
+ x="Score", y="Model", orientation="h",
98
+ color="Score", text="Score",
99
+ title="🀑 AI Model Performance(Fun)",
100
+ color_continuous_scale="electric"
101
+ )
102
+ fig.update_traces(textposition="outside")
103
+ return fig
104
+
105
+ # πŸ“ˆ **Animated Score Visualization for AI**
106
+ def generate_score_chart_conscious_ai(dataframe):
107
+ fig = px.bar(
108
+ dataframe[dataframe["Category"] == "Conscious"].sort_values(by="Score", ascending=True),
109
+ x="Score", y="Model", orientation="h",
110
+ color="Score", text="Score",
111
+ title="πŸ’  AI Model Performance(Conscious)",
112
+ color_continuous_scale="electric"
113
+ )
114
+ fig.update_traces(textposition="outside")
115
+ return fig
116
+
117
+ # πŸ“ˆ **Animated Score Visualization for AI**
118
+ def generate_score_chart_experimental_ai(dataframe):
119
+ fig = px.bar(
120
+ dataframe[dataframe["Category"] == "Experimental"].sort_values(by="Score", ascending=True),
121
+ x="Score", y="Model", orientation="h",
122
+ color="Score", text="Score",
123
+ title="πŸ”¬ AI Model Performance(Experimental)",
124
+ color_continuous_scale="electric"
125
+ )
126
+ fig.update_traces(textposition="outside")
127
+ return fig
128
+
129
+ # πŸ“ˆ **Animated Score Visualization for Laser Models**
130
+ def generate_score_chart_laser(dataframe):
131
+ fig = px.bar(
132
+ dataframe[dataframe["Category"] == "Laser"].sort_values(by="Score", ascending=True),
133
+ x="Score", y="Model", orientation="h",
134
+ color="Score", text="Score",
135
+ title="⚑ Laser Model Performance",
136
+ color_continuous_scale="electric"
137
+ )
138
+ fig.update_traces(textposition="outside")
139
+ return fig
140
+
141
+ # πŸ“ˆ **Combined Score Visualization for All Models**
142
+ # πŸ“ˆ **Combined Score Visualization for All Models (Large Chart)**
143
  def generate_score_chart_all_models(dataframe):
144
  fig = px.bar(
145
  dataframe.sort_values(by="Score", ascending=True),
 
149
  color_continuous_scale="electric"
150
  )
151
 
152
+ # Increase the size for better visibility of all models
153
  fig.update_layout(
154
+ height=800, # Increase the height to make the chart larger
155
+ width=1200, # Increase the width to fit all the data
156
  title_x=0.5, # Center the title
157
  title_y=0.95, # Adjust title position
158
+ margin=dict(l=200, r=50, t=50, b=50), # Adjust margins for better readability
159
  xaxis_title="Score", # X-axis title
160
  yaxis_title="Model", # Y-axis title
 
 
161
  )
162
 
163
  fig.update_traces(textposition="outside")
164
  return fig
165
+
166
+ # πŸ”₯ **Live Score Updates**
167
+ def update_scores():
168
+ global acc_models_df
169
+ prev_scores = acc_models_df["Score"].copy()
170
+ acc_models_df["Score"] += acc_models_df["Score"].apply(lambda x: random.randint(-2, 3))
171
+ acc_models_df["Score"] = acc_models_df["Score"].clip(70, 100)
172
+
173
+ # Detect if score increased & return sound effect
174
+ if (acc_models_df["Score"] > prev_scores).any():
175
+ return acc_models_df.sort_values(by="Score", ascending=False), SCORE_UP_SOUND
176
+ return acc_models_df.sort_values(by="Score", ascending=False), None
177
+
178
+ # 🎭 **Cyberpunk CSS Animations**
179
+ CUSTOM_CSS = """
180
+ h1 {
181
+ text-align: center;
182
+ font-size: 3em;
183
+ color: gold;
184
+ animation: glow 1.5s infinite alternate;
185
+ }
186
+
187
+ @keyframes glow {
188
+ from { text-shadow: 0 0 10px gold, 0 0 20px gold, 0 0 30px gold; }
189
+ to { text-shadow: 0 0 20px gold, 0 0 40px gold, 0 0 60px gold; }
190
+ }
191
+
192
+ .card-container {
193
+ display: flex;
194
+ flex-wrap: wrap;
195
+ gap: 20px;
196
+ justify-content: center;
197
+ }
198
+
199
+ .card {
200
+ width: 200px;
201
+ height: 250px;
202
+ perspective: 1000px;
203
+ }
204
+
205
+ .card-inner {
206
+ width: 100%;
207
+ height: 100%;
208
+ position: relative;
209
+ transform-style: preserve-3d;
210
+ transition: transform 0.8s;
211
+ }
212
+
213
+ .card:hover .card-inner {
214
+ transform: rotateY(180deg);
215
+ }
216
+
217
+ .card-front, .card-back {
218
+ width: 100%;
219
+ height: 100%;
220
+ position: absolute;
221
+ backface-visibility: hidden;
222
+ display: flex;
223
+ flex-direction: column;
224
+ align-items: center;
225
+ justify-content: center;
226
+ border-radius: 10px;
227
+ padding: 10px;
228
+ box-shadow: 0 0 10px rgba(255, 215, 0, 0.7); /* Gold glow effect */
229
+ }
230
+
231
+ .card-front {
232
+ background: #000;
233
+ color: gold;
234
+ }
235
+
236
+ .card-back {
237
+ background: #FFD700; /* Gold background */
238
+ color: black;
239
+ transform: rotateY(180deg);
240
+ }
241
+ """
242
+
243
+ # πŸ—οΈ **Gradio Interface**
244
+ demo = gr.Blocks(theme=THEME, css=CUSTOM_CSS)
245
+
246
+ with demo:
247
+ gr.HTML('<h1>πŸš€ ACC AI Model Leaderboard πŸ†</h1>')
248
+
249
+ with gr.Tabs():
250
+ with gr.TabItem("πŸ… Live Rankings"):
251
+ leaderboard = init_acc_leaderboard(acc_models_df)
252
+ leaderboard_display = gr.Dataframe(value=acc_models_df, interactive=False, label="πŸ”₯ Live Scores")
253
+ score_chart_ai = gr.Plot(generate_score_chart_ai(acc_models_df))
254
+ score_chart_assistant_ai = gr.Plot(generate_score_chart_assistant_ai(acc_models_df))
255
+ score_chart_fun_ai = gr.Plot(generate_score_chart_fun_ai(acc_models_df))
256
+ score_chart_conscious_ai = gr.Plot(generate_score_chart_conscious_ai(acc_models_df))
257
+ score_chart_experimental_ai = gr.Plot(generate_score_chart_experimental_ai(acc_models_df))
258
+ score_chart_laser = gr.Plot(generate_score_chart_laser(acc_models_df))
259
+ score_chart_all_models = gr.Plot(generate_score_chart_all_models(acc_models_df)) # New chart for all models
260
+ gr.HTML("<h3>🎨 AI Models</h3>")
261
+ gr.HTML("<h3>⚑ Laser Models</h3>")
262
+ gr.HTML("<h3>πŸ“Š All Models</h3>") # Title for the new chart
263
+ # πŸ”„ **Auto-Update Leaderboard**
264
+ scheduler = BackgroundScheduler()
265
+ scheduler.add_job(lambda: leaderboard_display.update(*update_scores()), "interval", seconds=10)
266
+ scheduler.start()
267
+
268
+ demo.launch()