TransformerAnalyzer / render_util.py
Alan Liu
inference speed
3698d0a
raw
history blame
565 Bytes
import streamlit as st
def create_table(df):
# Table header based on df columns
header = "| " + " | ".join(df.columns) + " |"
# Number of columns in df to set table divider accordingly
divider = "|:---" * len(df.columns[:-1]) + "|-----:|"
rows = [header, divider]
for _, row in df.iterrows():
rows.append("| " + " | ".join(row.astype(str)) + " |")
return "\n".join(rows)
def header3(text):
st.markdown(f"### {text}")
def header4(text):
st.markdown(f"#### {text}")
def header5(text):
st.markdown(f"##### {text}")