Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,145 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
#
|
12 |
fig.update_layout(
|
13 |
-
|
|
|
14 |
title_x=0.5, # Center the title
|
15 |
title_y=0.95, # Adjust title position
|
16 |
-
margin=dict(l=
|
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()
|