TejAndrewsACC commited on
Commit
e9ccecb
ยท
verified ยท
1 Parent(s): 9a8ab73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +65 -33
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"], # Data types: Model (str), Category (str), Description (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
- theme="TejAndrewsACC/ACC"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  with demo:
64
- gr.HTML("<h1>๐Ÿš€ ACC AI Model Leaderboard ๐Ÿ†</h1>")
65
 
66
  with gr.Tabs():
67
- # ๐Ÿ† **Leaderboard Tab**
68
- with gr.TabItem("๐Ÿ… ACC Model Rankings"):
69
  leaderboard = init_acc_leaderboard(acc_models_df)
70
-
 
71
  # ๐Ÿ“ **Submit New Model Tab**
72
- with gr.TabItem("๐Ÿš€ Submit a New ACC Model"):
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: None, "interval", seconds=1800) # Placeholder for restarting space if needed
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()