models-table / app.py
adt's picture
Upload app.py
7c580ce verified
Raw
History Blame Contribute Delete
1.68 kB
import gradio as gr
import pandas as pd
DESCRIPTION = """
# LifeArchitect.ai Models Table (Free Preview for Hugging Face πŸ€—)
Browse 900+ AI models with parameters, benchmarks, and metadata. Click column headers to sort.
**β–ˆβ–ˆβ–ˆ = redacted** for free preview. Upgrade to [Models Table Pro](https://lifearchitect.ai/models-table-pro/) for full access to all cells plus additional columns (training hardware, compute estimates, training cost, and more). All analysis by [LifeArchitect.ai](https://lifearchitect.ai/).
"""
CSS = """
.gradio-container { max-width: 100% !important; padding: 8px !important; }
.gradio-container h1 { font-size: 3em !important; }
.gradio-container p, .gradio-container span { font-size: 1.4em !important; }
table td, table th { font-size: 16px !important; padding: 4px 6px !important; }
table th { background: #2a2a2a !important; color: #fff !important; font-weight: 700 !important; cursor: pointer; white-space: nowrap; }
table tr:nth-child(even) { background: #f5f5f5 !important; }
table tr:hover { background: #e8e8f0 !important; }
"""
CLIP = {"Lab": 25, "Notes": 80, "Training dataset": 80, "Tags": 80}
df = pd.read_csv("models-table-free.csv", dtype=str, keep_default_na=False)
for col, maxlen in CLIP.items():
if col in df.columns:
df[col] = df[col].apply(lambda x: x[:maxlen] + "..." if len(x) > maxlen else x)
with gr.Blocks(title="Models Table Pro β€” Free Preview", css=CSS) as demo:
gr.Markdown(DESCRIPTION)
gr.Dataframe(
value=df,
headers=list(df.columns),
datatype=["str"] * len(df.columns),
interactive=False,
wrap=False,
max_height=1000,
)
demo.launch()