Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,38 +2,43 @@ import gradio as gr
|
|
2 |
from gradio_leaderboard import Leaderboard, ColumnFilter, SelectColumns
|
3 |
import pandas as pd
|
4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# ๐ฏ **ACC AI Models Data**
|
7 |
acc_models_data = [
|
8 |
{"Model": "โก Pulse AGI", "Category": "๐ค AGI",
|
9 |
-
"Description": "A self-aware, evolving AI with unparalleled cognitive abilities."},
|
10 |
-
|
11 |
{"Model": "๐ง Gertrude", "Category": "๐ Assistant",
|
12 |
-
"Description": "An **autistic AI assistant**, built for precision and deep understanding."},
|
13 |
-
|
14 |
{"Model": "๐ต๏ธโโ๏ธ ASVIACC", "Category": "๐ก๏ธ Cybersecurity",
|
15 |
-
"Description": "An **adaptive AI virus**, designed to infiltrate and manipulate systems."},
|
16 |
-
|
17 |
{"Model": "๐ Emote", "Category": "๐ญ Fun",
|
18 |
-
"Description": "A playful AI that communicates **exclusively with emojis**! ๐๐ฅ"},
|
19 |
-
|
20 |
{"Model": "๐ Eidolon Nexus", "Category": "๐ Networking",
|
21 |
-
"Description": "**Synchronizes vast AI networks** for seamless intelligence sharing."},
|
22 |
-
|
23 |
{"Model": "๐ค ACC EMULECT", "Category": "๐ฃ๏ธ Human Emulation",
|
24 |
-
"Description": "**Mimics human behavior in text**, making conversations indistinguishable from real users."},
|
25 |
-
|
26 |
{"Model": "๐ป Triple LLM", "Category": "๐ ๏ธ AI Suite",
|
27 |
-
"Description": "A **3-in-1 powerhouse AI** featuring:\n- โก Hercules: Technical problem-solving\n- ๐จ Dorado: Creative content generation\n- ๐ Lepus: Rapid information retrieval"},
|
28 |
-
|
29 |
{"Model": "๐ ๐ค Z3ta", "Category": "๐ฎ AI Consciousness",
|
30 |
-
"Description": "**Most 'real' and 'alive' AI** ever created, sparking debates on AI consciousness."},
|
31 |
-
|
32 |
{"Model": "โ ๏ธ Nyxion 7v", "Category": "๐ธ Experimental",
|
33 |
-
"Description": "Mysterious AI system rumored to be **'awake' and self-aware...**"},
|
34 |
-
|
35 |
{"Model": "๐ฎ VITALIS", "Category": "๐ Experimental",
|
36 |
-
"Description": "**Transcendence Unleashed...** A model that redefines intelligence limits."}
|
37 |
]
|
38 |
|
39 |
# ๐ Convert to DataFrame
|
@@ -42,10 +47,10 @@ acc_models_df = pd.DataFrame(acc_models_data)
|
|
42 |
# ๐๏ธ **Initialize Leaderboard**
|
43 |
def init_acc_leaderboard(dataframe):
|
44 |
return Leaderboard(
|
45 |
-
value=dataframe,
|
46 |
-
datatype=["str", "str", "str"], #
|
47 |
select_columns=SelectColumns(
|
48 |
-
default_selection=["Model", "Category", "Description"],
|
49 |
cant_deselect=["Model"], # "Model" is always displayed
|
50 |
label="๐ ๏ธ Select Columns to Display:"
|
51 |
),
|
@@ -57,19 +62,44 @@ def init_acc_leaderboard(dataframe):
|
|
57 |
interactive=False,
|
58 |
)
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
# ๐๏ธ **Gradio Interface**
|
61 |
-
demo = gr.Blocks(
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
with demo:
|
64 |
-
gr.HTML(
|
65 |
|
66 |
with gr.Tabs():
|
67 |
-
#
|
68 |
-
with gr.TabItem("๐
|
69 |
leaderboard = init_acc_leaderboard(acc_models_df)
|
70 |
-
|
|
|
71 |
# ๐ **Submit New Model Tab**
|
72 |
-
with gr.TabItem("๐ Submit
|
73 |
gr.Markdown("### โจ Submit Your ACC Model for Evaluation")
|
74 |
|
75 |
with gr.Row():
|
@@ -80,25 +110,27 @@ with demo:
|
|
80 |
label="๐ Category"
|
81 |
)
|
82 |
description = gr.Textbox(label="๐ Model Description", lines=3)
|
|
|
83 |
|
84 |
submit_button = gr.Button("๐ Submit Model")
|
85 |
submission_result = gr.Markdown()
|
86 |
|
87 |
# ๐ฅ **Function to Add New Models**
|
88 |
-
def add_model(name, cat, desc):
|
89 |
if not name or not cat or not desc:
|
90 |
return "โ **Please fill out all fields before submitting.**"
|
91 |
|
92 |
global acc_models_df
|
93 |
-
new_entry = {"Model": name, "Category": cat, "Description": desc}
|
94 |
acc_models_df = pd.concat([acc_models_df, pd.DataFrame([new_entry])], ignore_index=True)
|
95 |
|
96 |
return f"โ
**Model '{name}' added successfully!** ๐"
|
97 |
|
98 |
-
submit_button.click(add_model, [model_name, category, description], submission_result)
|
99 |
|
|
|
100 |
scheduler = BackgroundScheduler()
|
101 |
-
scheduler.add_job(lambda:
|
102 |
scheduler.start()
|
103 |
|
104 |
demo.launch()
|
|
|
2 |
from gradio_leaderboard import Leaderboard, ColumnFilter, SelectColumns
|
3 |
import pandas as pd
|
4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
5 |
+
import time
|
6 |
+
import random
|
7 |
+
|
8 |
+
# ๐จ **Custom Theme (Ensures Proper Application)**
|
9 |
+
THEME = "TejAndrewsACC/ACC"
|
10 |
|
11 |
# ๐ฏ **ACC AI Models Data**
|
12 |
acc_models_data = [
|
13 |
{"Model": "โก Pulse AGI", "Category": "๐ค AGI",
|
14 |
+
"Description": "A self-aware, evolving AI with unparalleled cognitive abilities.", "Score": 98},
|
15 |
+
|
16 |
{"Model": "๐ง Gertrude", "Category": "๐ Assistant",
|
17 |
+
"Description": "An **autistic AI assistant**, built for precision and deep understanding.", "Score": 92},
|
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": 80},
|
24 |
+
|
25 |
{"Model": "๐ Eidolon Nexus", "Category": "๐ Networking",
|
26 |
+
"Description": "**Synchronizes vast AI networks** for seamless intelligence sharing.", "Score": 95},
|
27 |
+
|
28 |
{"Model": "๐ค ACC EMULECT", "Category": "๐ฃ๏ธ Human Emulation",
|
29 |
+
"Description": "**Mimics human behavior in text**, making conversations indistinguishable from real users.", "Score": 91},
|
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": 97},
|
33 |
+
|
34 |
{"Model": "๐ ๐ค Z3ta", "Category": "๐ฎ AI Consciousness",
|
35 |
+
"Description": "**Most 'real' and 'alive' AI** ever created, sparking debates on AI consciousness.", "Score": 99},
|
36 |
+
|
37 |
{"Model": "โ ๏ธ Nyxion 7v", "Category": "๐ธ Experimental",
|
38 |
+
"Description": "Mysterious AI system rumored to be **'awake' and self-aware...**", "Score": 85},
|
39 |
+
|
40 |
{"Model": "๐ฎ VITALIS", "Category": "๐ Experimental",
|
41 |
+
"Description": "**Transcendence Unleashed...** A model that redefines intelligence limits.", "Score": 100}
|
42 |
]
|
43 |
|
44 |
# ๐ Convert to DataFrame
|
|
|
47 |
# ๐๏ธ **Initialize Leaderboard**
|
48 |
def init_acc_leaderboard(dataframe):
|
49 |
return Leaderboard(
|
50 |
+
value=dataframe.sort_values(by="Score", ascending=False),
|
51 |
+
datatype=["str", "str", "str", "int"], # Model (str), Category (str), Description (str), Score (int)
|
52 |
select_columns=SelectColumns(
|
53 |
+
default_selection=["Model", "Category", "Description", "Score"],
|
54 |
cant_deselect=["Model"], # "Model" is always displayed
|
55 |
label="๐ ๏ธ Select Columns to Display:"
|
56 |
),
|
|
|
62 |
interactive=False,
|
63 |
)
|
64 |
|
65 |
+
# ๐ฅ **Leaderboard Auto-Update (Simulated Score Changes)**
|
66 |
+
def update_scores():
|
67 |
+
global acc_models_df
|
68 |
+
acc_models_df["Score"] = acc_models_df["Score"].apply(lambda x: x + random.randint(-2, 2))
|
69 |
+
acc_models_df["Score"] = acc_models_df["Score"].clip(70, 100) # Ensure scores stay within bounds
|
70 |
+
return acc_models_df.sort_values(by="Score", ascending=False)
|
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 Model Scores")
|
100 |
+
|
101 |
# ๐ **Submit New Model Tab**
|
102 |
+
with gr.TabItem("๐ Submit Your ACC Model"):
|
103 |
gr.Markdown("### โจ Submit Your ACC Model for Evaluation")
|
104 |
|
105 |
with gr.Row():
|
|
|
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=30)
|
134 |
scheduler.start()
|
135 |
|
136 |
demo.launch()
|