grg's picture
Redesign and addition of content, adding LLama-3.1 8B and 70B
40c29ba
raw
history blame
No virus
571 Bytes
from flask import url_for
def df_to_table_html(df, additional_class=None):
classes = 'table table-striped table-bordered'
if additional_class is not None:
classes += f" {additional_class}"
full_table_html = df.to_html(classes=classes, escape=False, index=False)
# Modify the table HTML to add links to model names
for model in df['Model']:
model_link = f'<a href="{url_for("model_detail", model_name=model)}">{model}</a>'
full_table_html = full_table_html.replace(f'>{model}<', f'>{model_link}<')
return full_table_html