import pandas as pd import streamlit as st import math models_df = pd.read_csv("models_with_readmes.csv").dropna(subset=["readme"]) st.title("Huggingface model explorer") st.text(f"search {len(models_df)} models by name or readme") st.text("note that there are many more models but here we only show those with readme") query = st.text_input("model name query", value="") readme_query = st.text_input("readme query", value="") selected_models_df = models_df[ models_df["readme"].str.contains(readme_query) & models_df["modelId"].str.contains(query) ] n_per_page = 10 slider = st.number_input("page", 0, math.ceil(len(selected_models_df) / 10)) selected_models_df_subset = selected_models_df.iloc[ slider * n_per_page : (slider + 1) * n_per_page ] st.write(f"matched {len(selected_models_df)} models") for i, (model_name, readme) in enumerate(selected_models_df_subset[["modelId", "readme"]].itertuples(index=False)): st.write(readme)