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

Update app.py

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