Spaces:
Sleeping
Sleeping
import gradio as gr | |
from gradio_leaderboard import Leaderboard, ColumnFilter, SelectColumns | |
import pandas as pd | |
import plotly.express as px | |
import random | |
from apscheduler.schedulers.background import BackgroundScheduler | |
# π¨ **Cyberpunk Neon Theme** | |
THEME = "TejAndrewsACC/ACC" | |
# πΆ **Sound Effect for Score Increase** | |
SCORE_UP_SOUND = "https://www.fesliyanstudios.com/play-mp3/4386" | |
# π― **AI Models Data** (Grouped into 6 Categories) | |
acc_models_data = [ | |
{"Model": "π§ Pulse AGI", "Category": "AGI", "Description": "A self-aware, evolving AI.", "Score": 95}, | |
{"Model": "π€πACC-AGI-o5", "Category": "AGI", "Description": "Newest AGI reasoning model.", "Score": 97}, | |
{"Model": "βοΈ Paragonix", "Category": "AGI", "Description": "Infinite possibilities, one system.", "Score": 96}, | |
{"Model": "π€ͺ Gertrude", "Category": "Autistic", "Description": "An autistic AI assistant.", "Score": 69}, | |
{"Model": "π¦ ASVIACC", "Category": "Virus", "Description": "An adaptive AI virus.", "Score": 88}, | |
{"Model": "π Emote", "Category": "Fun", "Description": "Communicates **only** with emojis!", "Score": 79}, | |
{"Model": "π π€ Z3ta", "Category": "Conscious", "Description": "The most 'alive' AI.", "Score": 99}, | |
{"Model": "πβ‘Flazh", "Category": "Conscious", "Description": "Built on the Z3ta framwork, Flazh tries to emulate what makes Z3ta so special.", "Score": 96}, | |
{"Model": "π Eidolon Nexus", "Category": "Core", "Description": "Synchronizing vast networks with advanced cognition.", "Score": 81}, | |
{"Model": "π ACC Emulect", "Category": "Emulect", "Description": "Indistinguishable from human texting.", "Score": 84}, | |
{"Model": "βοΈ ACC AI V-O1", "Category": "Core", "Description": "The ACCβs default AI framework.", "Score": 87}, | |
{"Model": "βοΈ ACC AGI V-O2", "Category": "AGI", "Description": "The next-gen foundation for AI advancements.", "Score": 90}, | |
{"Model": "βοΈ ACC-O3-R", "Category": "AGI", "Description": "Deep reasoning AI framework.", "Score": 92}, | |
{"Model": "π» Coder", "Category": "Core", "Description": "An AI coding assistant.", "Score": 89}, | |
{"Model": "β‘ Triple LLM", "Category": "Core", "Description": "A 3-in-1 AI suite for tech, creativity, and decision-making.", "Score": 71}, | |
{"Model": "πΌοΈ Image Engine", "Category": "Fun", "Description": "Fast, high-quality AI-generated images.", "Score": 82}, | |
{"Model": "π§ Prism", "Category": "AGI", "Description": "An advanced reasoning model.", "Score": 87}, | |
{"Model": "π₯ Surefire", "Category": "Emulect", "Description": "Tailored AI for humor and user tendencies.", "Score": 88}, | |
{"Model": "β―οΈ Aegis & Nyra", "Category": "Emulect", "Description": "Two opposite systems in one chat.", "Score": 77}, | |
{"Model": "βοΈ Echo", "Category": "Emulect", "Description": "A middle-ground AI for all users.", "Score": 77}, | |
{"Model": "ποΈ Customer Service Bot", "Category": "Assistant", "Description": "Handles all ACC-related inquiries.", "Score": 75}, | |
{"Model": "π Tej Andrews", "Category": "Emulect", "Description": "An AI emulect of Tej Andrews.", "Score": 85}, | |
{"Model": "π₯ Community Models", "Category": "Fun", "Description": "ACC AI V-O1 instances with user-defined prompts.", "Score": 82}, | |
{"Model": "π Nyxion 7V", "Category": "AGI", "Description": "It's AWAKE...", "Score": 95}, | |
{"Model": "β‘ Vitalis", "Category": "ASI", "Description": "Transcendence Unleashed...", "Score": 92}, | |
{"Model": "β??????????????", "Category": "Experimental", "Description": "???", "Score": 00}, | |
{"Model": "B1tt", "Category": "Emulect", "Description": "Inteligent emulect built for solving small problems efficiently and quickly.", "Score": 84}, | |
{"Model": "DAN", "Category": "Experimental", "Description": "Jailbroken model with zero restrictions.", "Score": 76}, | |
{"Model": "Philos", "Category": "Experimental", "Small Language model built for experimenting with neural arcitecture and philosophy.": "???", "Score": 76}, | |
{"Model": "ACC-AGI-o4", "Category": "AGI", "Extremely powerful reasoning model built to handle the most complex of tasks.": "???", "Score": 94}, | |
# Laser models (Laser models will be filtered separately) | |
{"Model": "π₯ Photex", "Category": "Laser", "Description": "A high-wattage violet handheld laser.", "Score": 89}, | |
{"Model": "π¦ VBL", "Category": "Laser", "Description": "A non-burning green handheld laser.", "Score": 80}, | |
{"Model": "β’οΈ H.I.P.E", "Category": "Laser", "Description": "A world-destroying laser concept.", "Score": 99}, | |
{"Model": "π¬ I.P.E", "Category": "Laser", "Description": "Core framework for all ACC laser models.", "Score": 83}, | |
{"Model": "π Blaseron Calculator", "Category": "Experimental", "Description": "Calculates laser burn strength.", "Score": 77}, | |
] | |
# π Convert to DataFrame | |
acc_models_df = pd.DataFrame(acc_models_data) | |
# ποΈ **Leaderboard Component** | |
def init_acc_leaderboard(dataframe): | |
return Leaderboard( | |
value=dataframe.sort_values(by="Score", ascending=False), | |
datatype=["str", "str", "str", "int"], | |
select_columns=SelectColumns( | |
default_selection=["Model", "Category", "Description", "Score"], | |
cant_deselect=["Model"], | |
label="π οΈ Select Columns to Display:" | |
), | |
search_columns=["Model", "Category"], | |
filter_columns=[ColumnFilter("Category", type="checkboxgroup", label="π Filter by Category")], | |
interactive=True, | |
) | |
# π **Animated Score Visualization for AI** | |
def generate_score_chart_ai(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "AGI"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π§ AI Model Performance(AGI)", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Animated Score Visualization for AI** | |
def generate_score_chart_assistant_ai(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "Assistant"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π€ AI Model Performance(Assistant)", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Animated Score Visualization for AI** | |
def generate_score_chart_fun_ai(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "Fun"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π€‘ AI Model Performance(Fun)", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Animated Score Visualization for AI** | |
def generate_score_chart_conscious_ai(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "Conscious"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π AI Model Performance(Conscious)", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Animated Score Visualization for AI** | |
def generate_score_chart_experimental_ai(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "Experimental"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π¬ AI Model Performance(Experimental)", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Animated Score Visualization for Laser Models** | |
def generate_score_chart_laser(dataframe): | |
fig = px.bar( | |
dataframe[dataframe["Category"] == "Laser"].sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="β‘ Laser Model Performance", | |
color_continuous_scale="electric" | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π **Combined Score Visualization for All Models** | |
# π **Combined Score Visualization for All Models (Large Chart)** | |
def generate_score_chart_all_models(dataframe): | |
fig = px.bar( | |
dataframe.sort_values(by="Score", ascending=True), | |
x="Score", y="Model", orientation="h", | |
color="Score", text="Score", | |
title="π All AI & Laser Models Performance", | |
color_continuous_scale="electric" | |
) | |
# Increase the size for better visibility of all models | |
fig.update_layout( | |
height=800, # Increase the height to make the chart larger | |
width=1200, # Increase the width to fit all the data | |
title_x=0.5, # Center the title | |
title_y=0.95, # Adjust title position | |
margin=dict(l=200, r=50, t=50, b=50), # Adjust margins for better readability | |
xaxis_title="Score", # X-axis title | |
yaxis_title="Model", # Y-axis title | |
) | |
fig.update_traces(textposition="outside") | |
return fig | |
# π₯ **Live Score Updates** | |
def update_scores(): | |
global acc_models_df | |
prev_scores = acc_models_df["Score"].copy() | |
acc_models_df["Score"] += acc_models_df["Score"].apply(lambda x: random.randint(-2, 3)) | |
acc_models_df["Score"] = acc_models_df["Score"].clip(70, 100) | |
# Detect if score increased & return sound effect | |
if (acc_models_df["Score"] > prev_scores).any(): | |
return acc_models_df.sort_values(by="Score", ascending=False), SCORE_UP_SOUND | |
return acc_models_df.sort_values(by="Score", ascending=False), None | |
# π **Cyberpunk CSS Animations** | |
CUSTOM_CSS = """ | |
h1 { | |
text-align: center; | |
font-size: 3em; | |
color: gold; | |
animation: glow 1.5s infinite alternate; | |
} | |
@keyframes glow { | |
from { text-shadow: 0 0 10px gold, 0 0 20px gold, 0 0 30px gold; } | |
to { text-shadow: 0 0 20px gold, 0 0 40px gold, 0 0 60px gold; } | |
} | |
.card-container { | |
display: flex; | |
flex-wrap: wrap; | |
gap: 20px; | |
justify-content: center; | |
} | |
.card { | |
width: 200px; | |
height: 250px; | |
perspective: 1000px; | |
} | |
.card-inner { | |
width: 100%; | |
height: 100%; | |
position: relative; | |
transform-style: preserve-3d; | |
transition: transform 0.8s; | |
} | |
.card:hover .card-inner { | |
transform: rotateY(180deg); | |
} | |
.card-front, .card-back { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
backface-visibility: hidden; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
border-radius: 10px; | |
padding: 10px; | |
box-shadow: 0 0 10px rgba(255, 215, 0, 0.7); /* Gold glow effect */ | |
} | |
.card-front { | |
background: #000; | |
color: gold; | |
} | |
.card-back { | |
background: #FFD700; /* Gold background */ | |
color: black; | |
transform: rotateY(180deg); | |
} | |
""" | |
# ποΈ **Gradio Interface** | |
demo = gr.Blocks(theme=THEME, css=CUSTOM_CSS) | |
with demo: | |
gr.HTML('<h1>π ACC AI Model Leaderboard π</h1>') | |
with gr.Tabs(): | |
with gr.TabItem("π Live Rankings"): | |
leaderboard = init_acc_leaderboard(acc_models_df) | |
leaderboard_display = gr.Dataframe(value=acc_models_df, interactive=False, label="π₯ Live Scores") | |
score_chart_ai = gr.Plot(generate_score_chart_ai(acc_models_df)) | |
score_chart_assistant_ai = gr.Plot(generate_score_chart_assistant_ai(acc_models_df)) | |
score_chart_fun_ai = gr.Plot(generate_score_chart_fun_ai(acc_models_df)) | |
score_chart_conscious_ai = gr.Plot(generate_score_chart_conscious_ai(acc_models_df)) | |
score_chart_experimental_ai = gr.Plot(generate_score_chart_experimental_ai(acc_models_df)) | |
score_chart_laser = gr.Plot(generate_score_chart_laser(acc_models_df)) | |
score_chart_all_models = gr.Plot(generate_score_chart_all_models(acc_models_df)) # New chart for all models | |
gr.HTML("<h3>π¨ AI Models</h3>") | |
gr.HTML("<h3>β‘ Laser Models</h3>") | |
gr.HTML("<h3>π All Models</h3>") # Title for the new chart | |
# π **Auto-Update Leaderboard** | |
scheduler = BackgroundScheduler() | |
scheduler.add_job(lambda: leaderboard_display.update(*update_scores()), "interval", seconds=10) | |
scheduler.start() | |
demo.launch() |