Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -193,10 +193,16 @@ def clear_all():
|
|
193 |
def get_top_genomes(n=5):
|
194 |
if os.path.exists(GENOME_LOG):
|
195 |
df = pd.read_csv(GENOME_LOG)
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
198 |
else:
|
199 |
-
return pd.DataFrame()
|
|
|
200 |
|
201 |
# 🖼️ UI
|
202 |
with gr.Blocks(title="🧠 Evo – Reasoning AI") as demo:
|
|
|
193 |
def get_top_genomes(n=5):
|
194 |
if os.path.exists(GENOME_LOG):
|
195 |
df = pd.read_csv(GENOME_LOG)
|
196 |
+
|
197 |
+
# 🛡 Check if 'score' column exists
|
198 |
+
if "score" in df.columns:
|
199 |
+
df = df.sort_values(by="score", ascending=False).head(n)
|
200 |
+
return df.reset_index(drop=True)
|
201 |
+
else:
|
202 |
+
return pd.DataFrame({"error": ["No 'score' column in genome_log.csv"]})
|
203 |
else:
|
204 |
+
return pd.DataFrame({"error": ["No genome_log.csv found"]})
|
205 |
+
|
206 |
|
207 |
# 🖼️ UI
|
208 |
with gr.Blocks(title="🧠 Evo – Reasoning AI") as demo:
|