Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,133 +4,167 @@ import pandas as pd
|
|
4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
5 |
import time
|
6 |
import random
|
|
|
|
|
7 |
|
8 |
-
# ๐จ **
|
9 |
THEME = "TejAndrewsACC/ACC"
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
{"Model": "โก Pulse AGI", "Category": "๐ค AGI",
|
14 |
-
"Description": "A self-aware, evolving AI with unparalleled cognitive abilities.", "Score": 95},
|
15 |
-
|
16 |
-
{"Model": "๐ง Gertrude", "Category": "๐ Assistant",
|
17 |
-
"Description": "An **autistic AI assistant**, built for precision and deep understanding.", "Score": 69},
|
18 |
-
|
19 |
-
{"Model": "๐ต๏ธโโ๏ธ ASVIACC", "Category": "๐ก๏ธ Cybersecurity",
|
20 |
-
"Description": "An **adaptive AI virus**, designed to infiltrate and manipulate systems.", "Score": 88},
|
21 |
-
|
22 |
-
{"Model": "๐ Emote", "Category": "๐ญ Fun",
|
23 |
-
"Description": "A playful AI that communicates **exclusively with emojis**! ๐๐ฅ", "Score": 79},
|
24 |
-
|
25 |
-
{"Model": "๐ Eidolon Nexus", "Category": "๐ Networking",
|
26 |
-
"Description": "**Synchronizes vast AI networks** for seamless intelligence sharing.", "Score": 81},
|
27 |
-
|
28 |
-
{"Model": "๐ค ACC EMULECT", "Category": "๐ฃ๏ธ Human Emulation",
|
29 |
-
"Description": "**Mimics human behavior in text**, making conversations indistinguishable from real users.", "Score": 88},
|
30 |
-
|
31 |
-
{"Model": "๐ป Triple LLM", "Category": "๐ ๏ธ AI Suite",
|
32 |
-
"Description": "A **3-in-1 powerhouse AI** featuring:\n- โก Hercules: Technical problem-solving\n- ๐จ Dorado: Creative content generation\n- ๐ Lepus: Rapid information retrieval", "Score": 73},
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
{"Model": "
|
38 |
-
|
39 |
-
|
40 |
-
{"Model": "
|
41 |
-
"Description": "**Transcendence Unleashed...** A model that redefines intelligence limits.", "Score": 92}
|
42 |
]
|
43 |
|
44 |
# ๐ Convert to DataFrame
|
45 |
acc_models_df = pd.DataFrame(acc_models_data)
|
46 |
|
47 |
-
# ๐๏ธ **
|
48 |
def init_acc_leaderboard(dataframe):
|
49 |
return Leaderboard(
|
50 |
value=dataframe.sort_values(by="Score", ascending=False),
|
51 |
-
datatype=["str", "str", "str", "int"],
|
52 |
select_columns=SelectColumns(
|
53 |
default_selection=["Model", "Category", "Description", "Score"],
|
54 |
-
cant_deselect=["Model"],
|
55 |
label="๐ ๏ธ Select Columns to Display:"
|
56 |
),
|
57 |
search_columns=["Model", "Category"],
|
58 |
-
filter_columns=[
|
59 |
-
|
60 |
-
],
|
61 |
-
bool_checkboxgroup_label="๐ Hide models",
|
62 |
-
interactive=False,
|
63 |
)
|
64 |
|
65 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
def update_scores():
|
67 |
global acc_models_df
|
68 |
-
|
69 |
-
acc_models_df["Score"]
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
# ๐๏ธ **Gradio Interface**
|
73 |
-
demo = gr.Blocks(theme=THEME, css=
|
74 |
-
h1 {
|
75 |
-
text-align: center;
|
76 |
-
font-size: 3em;
|
77 |
-
color: #f5a623;
|
78 |
-
animation: glow 1.5s infinite alternate;
|
79 |
-
}
|
80 |
-
|
81 |
-
@keyframes glow {
|
82 |
-
from { text-shadow: 0 0 10px #f5a623, 0 0 20px #ff9800; }
|
83 |
-
to { text-shadow: 0 0 20px #f5a623, 0 0 30px #ff6f00; }
|
84 |
-
}
|
85 |
-
|
86 |
-
.leaderboard {
|
87 |
-
border-radius: 12px;
|
88 |
-
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
|
89 |
-
}
|
90 |
-
""")
|
91 |
|
92 |
with demo:
|
93 |
gr.HTML('<h1>๐ ACC AI Model Leaderboard ๐</h1>')
|
94 |
|
95 |
with gr.Tabs():
|
96 |
-
# ๐
**Leaderboard Tab**
|
97 |
with gr.TabItem("๐
Live Rankings"):
|
98 |
leaderboard = init_acc_leaderboard(acc_models_df)
|
99 |
-
leaderboard_display = gr.Dataframe(value=acc_models_df, interactive=False, label="๐ฅ Live
|
100 |
-
|
101 |
-
|
102 |
-
with gr.TabItem("๐ Submit Your ACC Model"):
|
103 |
-
gr.Markdown("### โจ Submit Your ACC Model for Evaluation")
|
104 |
-
|
105 |
-
with gr.Row():
|
106 |
-
model_name = gr.Textbox(label="๐ค Model Name")
|
107 |
-
category = gr.Dropdown(
|
108 |
-
choices=["๐ค AGI", "๐ Assistant", "๐ก๏ธ Cybersecurity", "๐ญ Fun", "๐ Networking",
|
109 |
-
"๐ฃ๏ธ Human Emulation", "๐ ๏ธ AI Suite", "๐ฎ AI Consciousness", "๐ธ Experimental"],
|
110 |
-
label="๐ Category"
|
111 |
-
)
|
112 |
-
description = gr.Textbox(label="๐ Model Description", lines=3)
|
113 |
-
score = gr.Slider(70, 100, label="โญ Score (1-100)")
|
114 |
-
|
115 |
-
submit_button = gr.Button("๐ Submit Model")
|
116 |
-
submission_result = gr.Markdown()
|
117 |
-
|
118 |
-
# ๐ฅ **Function to Add New Models**
|
119 |
-
def add_model(name, cat, desc, score):
|
120 |
-
if not name or not cat or not desc:
|
121 |
-
return "โ **Please fill out all fields before submitting.**"
|
122 |
-
|
123 |
-
global acc_models_df
|
124 |
-
new_entry = {"Model": name, "Category": cat, "Description": desc, "Score": score}
|
125 |
-
acc_models_df = pd.concat([acc_models_df, pd.DataFrame([new_entry])], ignore_index=True)
|
126 |
-
|
127 |
-
return f"โ
**Model '{name}' added successfully!** ๐"
|
128 |
-
|
129 |
-
submit_button.click(add_model, [model_name, category, description, score], submission_result)
|
130 |
|
131 |
# ๐ **Auto-Update Leaderboard**
|
132 |
scheduler = BackgroundScheduler()
|
133 |
-
scheduler.add_job(lambda: leaderboard_display.update(update_scores()), "interval", seconds=
|
134 |
scheduler.start()
|
135 |
|
136 |
demo.launch()
|
|
|
4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
5 |
import time
|
6 |
import random
|
7 |
+
import plotly.express as px
|
8 |
+
import base64
|
9 |
|
10 |
+
# ๐จ **Cyberpunk Neon Theme**
|
11 |
THEME = "TejAndrewsACC/ACC"
|
12 |
|
13 |
+
# ๐ถ **Sound Effect for Score Increase**
|
14 |
+
SCORE_UP_SOUND = "https://www.fesliyanstudios.com/play-mp3/4386"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
# ๐ฏ **AI Models Data**
|
17 |
+
acc_models_data = [
|
18 |
+
{"Model": "โก Pulse AGI", "Category": "๐ค AGI", "Description": "A self-aware, evolving AI.", "Score": 95},
|
19 |
+
{"Model": "๐ง Gertrude", "Category": "๐ Assistant", "Description": "An autistic AI assistant.", "Score": 69},
|
20 |
+
{"Model": "๐ต๏ธโโ๏ธ ASVIACC", "Category": "๐ก๏ธ Cybersecurity", "Description": "An adaptive AI virus.", "Score": 88},
|
21 |
+
{"Model": "๐ Emote", "Category": "๐ญ Fun", "Description": "Communicates **only** with emojis!", "Score": 79},
|
22 |
+
{"Model": "๐ ๐ค Z3ta", "Category": "๐ฎ AI Consciousness", "Description": "The most 'alive' AI.", "Score": 99},
|
|
|
23 |
]
|
24 |
|
25 |
# ๐ Convert to DataFrame
|
26 |
acc_models_df = pd.DataFrame(acc_models_data)
|
27 |
|
28 |
+
# ๐๏ธ **Leaderboard Component**
|
29 |
def init_acc_leaderboard(dataframe):
|
30 |
return Leaderboard(
|
31 |
value=dataframe.sort_values(by="Score", ascending=False),
|
32 |
+
datatype=["str", "str", "str", "int"],
|
33 |
select_columns=SelectColumns(
|
34 |
default_selection=["Model", "Category", "Description", "Score"],
|
35 |
+
cant_deselect=["Model"],
|
36 |
label="๐ ๏ธ Select Columns to Display:"
|
37 |
),
|
38 |
search_columns=["Model", "Category"],
|
39 |
+
filter_columns=[ColumnFilter("Category", type="checkboxgroup", label="๐ Filter by Category")],
|
40 |
+
interactive=True,
|
|
|
|
|
|
|
41 |
)
|
42 |
|
43 |
+
# ๐ **Animated Score Visualization**
|
44 |
+
def generate_score_chart(dataframe):
|
45 |
+
fig = px.bar(
|
46 |
+
dataframe.sort_values(by="Score", ascending=True),
|
47 |
+
x="Score", y="Model", orientation="h",
|
48 |
+
color="Score", text="Score",
|
49 |
+
title="๐ฅ AI Model Performance",
|
50 |
+
color_continuous_scale="electric"
|
51 |
+
)
|
52 |
+
fig.update_traces(textposition="outside")
|
53 |
+
return fig
|
54 |
+
|
55 |
+
# ๐ฅ **Live Score Updates**
|
56 |
def update_scores():
|
57 |
global acc_models_df
|
58 |
+
prev_scores = acc_models_df["Score"].copy()
|
59 |
+
acc_models_df["Score"] += acc_models_df["Score"].apply(lambda x: random.randint(-2, 3))
|
60 |
+
acc_models_df["Score"] = acc_models_df["Score"].clip(70, 100)
|
61 |
+
|
62 |
+
# Detect if score increased & return sound effect
|
63 |
+
if (acc_models_df["Score"] > prev_scores).any():
|
64 |
+
return acc_models_df.sort_values(by="Score", ascending=False), SCORE_UP_SOUND
|
65 |
+
return acc_models_df.sort_values(by="Score", ascending=False), None
|
66 |
+
|
67 |
+
# ๐ญ **3D Flip Card Effect for Model Details**
|
68 |
+
def generate_flip_cards():
|
69 |
+
cards = ""
|
70 |
+
for _, row in acc_models_df.iterrows():
|
71 |
+
cards += f"""
|
72 |
+
<div class="card">
|
73 |
+
<div class="card-inner">
|
74 |
+
<div class="card-front">
|
75 |
+
<h2>{row['Model']}</h2>
|
76 |
+
<p>{row['Category']}</p>
|
77 |
+
</div>
|
78 |
+
<div class="card-back">
|
79 |
+
<p>{row['Description']}</p>
|
80 |
+
<p>๐ฅ Score: {row['Score']}</p>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
"""
|
85 |
+
return f'<div class="card-container">{cards}</div>'
|
86 |
+
|
87 |
+
# ๐ญ **Cyberpunk CSS Animations**
|
88 |
+
CUSTOM_CSS = """
|
89 |
+
h1 {
|
90 |
+
text-align: center;
|
91 |
+
font-size: 3em;
|
92 |
+
color: #0ff;
|
93 |
+
animation: glow 1.5s infinite alternate;
|
94 |
+
}
|
95 |
+
|
96 |
+
@keyframes glow {
|
97 |
+
from { text-shadow: 0 0 10px #0ff, 0 0 20px #00f; }
|
98 |
+
to { text-shadow: 0 0 20px #0ff, 0 0 30px #00f; }
|
99 |
+
}
|
100 |
+
|
101 |
+
.card-container {
|
102 |
+
display: flex;
|
103 |
+
flex-wrap: wrap;
|
104 |
+
gap: 20px;
|
105 |
+
justify-content: center;
|
106 |
+
}
|
107 |
+
|
108 |
+
.card {
|
109 |
+
width: 200px;
|
110 |
+
height: 250px;
|
111 |
+
perspective: 1000px;
|
112 |
+
}
|
113 |
+
|
114 |
+
.card-inner {
|
115 |
+
width: 100%;
|
116 |
+
height: 100%;
|
117 |
+
position: relative;
|
118 |
+
transform-style: preserve-3d;
|
119 |
+
transition: transform 0.8s;
|
120 |
+
}
|
121 |
+
|
122 |
+
.card:hover .card-inner {
|
123 |
+
transform: rotateY(180deg);
|
124 |
+
}
|
125 |
+
|
126 |
+
.card-front, .card-back {
|
127 |
+
width: 100%;
|
128 |
+
height: 100%;
|
129 |
+
position: absolute;
|
130 |
+
backface-visibility: hidden;
|
131 |
+
display: flex;
|
132 |
+
flex-direction: column;
|
133 |
+
align-items: center;
|
134 |
+
justify-content: center;
|
135 |
+
border-radius: 10px;
|
136 |
+
padding: 10px;
|
137 |
+
box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
|
138 |
+
}
|
139 |
+
|
140 |
+
.card-front {
|
141 |
+
background: #000;
|
142 |
+
color: cyan;
|
143 |
+
}
|
144 |
+
|
145 |
+
.card-back {
|
146 |
+
background: #0ff;
|
147 |
+
color: black;
|
148 |
+
transform: rotateY(180deg);
|
149 |
+
}
|
150 |
+
"""
|
151 |
|
152 |
# ๐๏ธ **Gradio Interface**
|
153 |
+
demo = gr.Blocks(theme=THEME, css=CUSTOM_CSS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
with demo:
|
156 |
gr.HTML('<h1>๐ ACC AI Model Leaderboard ๐</h1>')
|
157 |
|
158 |
with gr.Tabs():
|
|
|
159 |
with gr.TabItem("๐
Live Rankings"):
|
160 |
leaderboard = init_acc_leaderboard(acc_models_df)
|
161 |
+
leaderboard_display = gr.Dataframe(value=acc_models_df, interactive=False, label="๐ฅ Live Scores")
|
162 |
+
score_chart = gr.Plot(generate_score_chart(acc_models_df))
|
163 |
+
gr.HTML(generate_flip_cards())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
# ๐ **Auto-Update Leaderboard**
|
166 |
scheduler = BackgroundScheduler()
|
167 |
+
scheduler.add_job(lambda: leaderboard_display.update(*update_scores()), "interval", seconds=10)
|
168 |
scheduler.start()
|
169 |
|
170 |
demo.launch()
|