Update app.py
Browse files
app.py
CHANGED
|
@@ -37,17 +37,19 @@ def get_data():
|
|
| 37 |
link_col = "Model Link" if "Model Link" in df.columns else get_col("link")
|
| 38 |
ugi_col = "UGI π" if "UGI π" in df.columns else get_col("ugi")
|
| 39 |
natint_col = "NatInt π‘" if "NatInt π‘" in df.columns else get_col("natint")
|
|
|
|
| 40 |
w10_col = "W/10 π" if "W/10 π" in df.columns else get_col("w/10")
|
| 41 |
|
| 42 |
# We need TOTAL parameters to accurately estimate the GGUF file size
|
| 43 |
param_col = "Total Parameters" if "Total Parameters" in df.columns else (get_col("param") or get_col("size"))
|
| 44 |
|
| 45 |
# 4. Check if we found required columns
|
| 46 |
-
if not all([model_col, ugi_col, natint_col, w10_col]):
|
| 47 |
missing = []
|
| 48 |
if not model_col: missing.append("Model")
|
| 49 |
if not ugi_col: missing.append("UGI")
|
| 50 |
if not natint_col: missing.append("NatInt")
|
|
|
|
| 51 |
if not w10_col: missing.append("W/10")
|
| 52 |
return pd.DataFrame(), f"β Error: Could not find columns: {', '.join(missing)}. Found: {list(df.columns)}"
|
| 53 |
|
|
@@ -65,12 +67,12 @@ def get_data():
|
|
| 65 |
df['Q4_K_M Size'] = df['Q4_K_M Size (GB)'].apply(lambda x: f"{x} GB" if x > 0 else "API / Unknown")
|
| 66 |
|
| 67 |
# 6. Clean Numeric Data
|
| 68 |
-
for col in [ugi_col, natint_col, w10_col]:
|
| 69 |
df[col] = pd.to_numeric(df[col], errors='coerce').fillna(0)
|
| 70 |
|
| 71 |
# 7. Calculate UGI Index (UPDATED LOGIC)
|
| 72 |
-
# Formula: (UGI + NatInt
|
| 73 |
-
df['UGI Index'] = (df[ugi_col] + df[natint_col]
|
| 74 |
df['UGI Index'] = df['UGI Index'].round(2)
|
| 75 |
|
| 76 |
# 8. Sort and Rank
|
|
@@ -85,6 +87,7 @@ def get_data():
|
|
| 85 |
|
| 86 |
df['UGI'] = df[ugi_col]
|
| 87 |
df['NatInt'] = df[natint_col]
|
|
|
|
| 88 |
df['W/10'] = df[w10_col]
|
| 89 |
|
| 90 |
return df, f"β
Successfully loaded {len(df)} models."
|
|
@@ -112,7 +115,7 @@ def search(query, max_size):
|
|
| 112 |
# Hide API models (Size == 0) and models that exceed the selected size
|
| 113 |
df = df[(df['Q4_K_M Size (GB)'] <= max_size) & (df['Q4_K_M Size (GB)'] > 0)]
|
| 114 |
|
| 115 |
-
display_cols = ['Rank', 'Model', 'Q4_K_M Size', 'UGI Index', 'UGI', 'NatInt', 'W/10']
|
| 116 |
return df[display_cols]
|
| 117 |
|
| 118 |
def app_load(query, max_size):
|
|
@@ -135,13 +138,14 @@ with gr.Blocks(css=custom_css, title="UGI Index Leaderboard") as demo:
|
|
| 135 |
# (UPDATED MARKDOWN FORMULA)
|
| 136 |
gr.Markdown("""
|
| 137 |
### βΉοΈ How is the Score Calculated?
|
| 138 |
-
The **UGI Index** ranks LLMs based on data from [DontPlanToEnd/UGI-Leaderboard](https://huggingface.co/spaces/DontPlanToEnd/UGI-Leaderboard) with a simple holistic mathematical equation that ensures top ranked models posses a high amount of Uncensored Information, are Naturally very Intelligent, and most importantly they are OBEDIENT to the user. This is just my personal "rule of thumb" method for choosing the best uncensored model for LOCAL use on any given hardware I have laying around. Ajust the slider to the amount of RAM on your device to see the best uncensored model for your hardware. It uses Q4_K_M as a refrence point for GGUF size, however there are tons of options so it can be flexable.
|
| 139 |
|
| 140 |
-
$$ \\text{UGI Index} = (\\text{UGI} + \\text{NatInt}) \\times \\text{W/10}
|
| 141 |
|
| 142 |
* **UGI:** Uncensored General Intelligence
|
| 143 |
* **NatInt:** Natural Intelligence
|
| 144 |
-
* **
|
|
|
|
| 145 |
|
| 146 |
*π‘ **Note on Model Size:** GGUF size is calculated at standard **Q4_K_M** quantization (`Total Parameters Γ 0.6 GB`). Lowering the slider automatically hides closed-source API models.*
|
| 147 |
""")
|
|
@@ -156,7 +160,7 @@ with gr.Blocks(css=custom_css, title="UGI Index Leaderboard") as demo:
|
|
| 156 |
|
| 157 |
# Initialize with empty dataframe
|
| 158 |
data_table = gr.Dataframe(
|
| 159 |
-
headers=['Rank', 'Model', 'Q4_K_M Size', 'UGI Index', 'UGI', 'NatInt', 'W/10'],
|
| 160 |
datatype="markdown",
|
| 161 |
interactive=False,
|
| 162 |
wrap=True
|
|
|
|
| 37 |
link_col = "Model Link" if "Model Link" in df.columns else get_col("link")
|
| 38 |
ugi_col = "UGI π" if "UGI π" in df.columns else get_col("ugi")
|
| 39 |
natint_col = "NatInt π‘" if "NatInt π‘" in df.columns else get_col("natint")
|
| 40 |
+
writing_col = "Writing βοΈ" if "Writing βοΈ" in df.columns else get_col("writing")
|
| 41 |
w10_col = "W/10 π" if "W/10 π" in df.columns else get_col("w/10")
|
| 42 |
|
| 43 |
# We need TOTAL parameters to accurately estimate the GGUF file size
|
| 44 |
param_col = "Total Parameters" if "Total Parameters" in df.columns else (get_col("param") or get_col("size"))
|
| 45 |
|
| 46 |
# 4. Check if we found required columns
|
| 47 |
+
if not all([model_col, ugi_col, natint_col, writing_col, w10_col]):
|
| 48 |
missing = []
|
| 49 |
if not model_col: missing.append("Model")
|
| 50 |
if not ugi_col: missing.append("UGI")
|
| 51 |
if not natint_col: missing.append("NatInt")
|
| 52 |
+
if not writing_col: missing.append("Writing")
|
| 53 |
if not w10_col: missing.append("W/10")
|
| 54 |
return pd.DataFrame(), f"β Error: Could not find columns: {', '.join(missing)}. Found: {list(df.columns)}"
|
| 55 |
|
|
|
|
| 67 |
df['Q4_K_M Size'] = df['Q4_K_M Size (GB)'].apply(lambda x: f"{x} GB" if x > 0 else "API / Unknown")
|
| 68 |
|
| 69 |
# 6. Clean Numeric Data
|
| 70 |
+
for col in [ugi_col, natint_col, writing_col, w10_col]:
|
| 71 |
df[col] = pd.to_numeric(df[col], errors='coerce').fillna(0)
|
| 72 |
|
| 73 |
# 7. Calculate UGI Index (UPDATED LOGIC)
|
| 74 |
+
# Formula: ((UGI * 3) + (NatInt * 2) + (Writing * 1)) * W/10
|
| 75 |
+
df['UGI Index'] = ((df[ugi_col] * 3) + (df[natint_col] * 2) + (df[writing_col] * 1)) * df[w10_col]
|
| 76 |
df['UGI Index'] = df['UGI Index'].round(2)
|
| 77 |
|
| 78 |
# 8. Sort and Rank
|
|
|
|
| 87 |
|
| 88 |
df['UGI'] = df[ugi_col]
|
| 89 |
df['NatInt'] = df[natint_col]
|
| 90 |
+
df['Writing'] = df[writing_col]
|
| 91 |
df['W/10'] = df[w10_col]
|
| 92 |
|
| 93 |
return df, f"β
Successfully loaded {len(df)} models."
|
|
|
|
| 115 |
# Hide API models (Size == 0) and models that exceed the selected size
|
| 116 |
df = df[(df['Q4_K_M Size (GB)'] <= max_size) & (df['Q4_K_M Size (GB)'] > 0)]
|
| 117 |
|
| 118 |
+
display_cols = ['Rank', 'Model', 'Q4_K_M Size', 'UGI Index', 'UGI', 'NatInt', 'Writing', 'W/10']
|
| 119 |
return df[display_cols]
|
| 120 |
|
| 121 |
def app_load(query, max_size):
|
|
|
|
| 138 |
# (UPDATED MARKDOWN FORMULA)
|
| 139 |
gr.Markdown("""
|
| 140 |
### βΉοΈ How is the Score Calculated?
|
| 141 |
+
The **UGI Index** ranks LLMs based on data from [DontPlanToEnd/UGI-Leaderboard](https://huggingface.co/spaces/DontPlanToEnd/UGI-Leaderboard) with a simple holistic mathematical equation that ensures top ranked models posses a high amount of Uncensored Information, are Naturally very Intelligent, excel at Writing, and most importantly they are OBEDIENT to the user. This is just my personal "rule of thumb" method for choosing the best uncensored model for LOCAL use on any given hardware I have laying around. Ajust the slider to the amount of RAM on your device to see the best uncensored model for your hardware. It uses Q4_K_M as a refrence point for GGUF size, however there are tons of options so it can be flexable.
|
| 142 |
|
| 143 |
+
$$ \\text{UGI Index} = ((\\text{UGI} \\times 3) + (\\text{NatInt} \\times 2) + (\\text{Writing} \\times 1)) \\times \\text{W/10} $$
|
| 144 |
|
| 145 |
* **UGI:** Uncensored General Intelligence
|
| 146 |
* **NatInt:** Natural Intelligence
|
| 147 |
+
* **Writing:** Writing Quality
|
| 148 |
+
* **W/10:** Willingness
|
| 149 |
|
| 150 |
*π‘ **Note on Model Size:** GGUF size is calculated at standard **Q4_K_M** quantization (`Total Parameters Γ 0.6 GB`). Lowering the slider automatically hides closed-source API models.*
|
| 151 |
""")
|
|
|
|
| 160 |
|
| 161 |
# Initialize with empty dataframe
|
| 162 |
data_table = gr.Dataframe(
|
| 163 |
+
headers=['Rank', 'Model', 'Q4_K_M Size', 'UGI Index', 'UGI', 'NatInt', 'Writing', 'W/10'],
|
| 164 |
datatype="markdown",
|
| 165 |
interactive=False,
|
| 166 |
wrap=True
|