Update app.py
Browse files
app.py
CHANGED
|
@@ -124,4 +124,33 @@ with gr.Blocks(css=custom_css, title="UGI Index Leaderboard") as demo:
|
|
| 124 |
* **UGI:** Uncensored General Intelligence
|
| 125 |
* **NatInt:** Natural Intelligence
|
| 126 |
* **W/10:** Willingness
|
| 127 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
* **UGI:** Uncensored General Intelligence
|
| 125 |
* **NatInt:** Natural Intelligence
|
| 126 |
* **W/10:** Willingness
|
| 127 |
+
""")
|
| 128 |
+
# ------------------------------------------
|
| 129 |
+
|
| 130 |
+
with gr.Row():
|
| 131 |
+
status_box = gr.Textbox(label="Status", value="Initializing...", interactive=False, scale=4)
|
| 132 |
+
refresh_btn = gr.Button("Refresh Data", scale=1)
|
| 133 |
+
|
| 134 |
+
with gr.Row():
|
| 135 |
+
search_box = gr.Textbox(label="Search Models", placeholder="Type model name...", interactive=True)
|
| 136 |
+
|
| 137 |
+
# Initialize with empty dataframe
|
| 138 |
+
data_table = gr.Dataframe(
|
| 139 |
+
headers=['Rank', 'Model', 'UGI Index', 'UGI', 'NatInt', 'W/10'],
|
| 140 |
+
datatype="markdown",
|
| 141 |
+
interactive=False,
|
| 142 |
+
wrap=True
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
# Wire up events
|
| 146 |
+
# 1. On Load: Fetch data, update table and status
|
| 147 |
+
demo.load(fn=app_load, outputs=[data_table, status_box])
|
| 148 |
+
|
| 149 |
+
# 2. On Refresh: Fetch data again
|
| 150 |
+
refresh_btn.click(fn=app_load, outputs=[data_table, status_box])
|
| 151 |
+
|
| 152 |
+
# 3. On Search: Filter existing data
|
| 153 |
+
search_box.change(fn=search, inputs=search_box, outputs=data_table)
|
| 154 |
+
|
| 155 |
+
if __name__ == "__main__":
|
| 156 |
+
demo.launch()
|