in app.py [0:0]
def show_column(dstats, display_list, show_perplexities, column_id=""):
"""
Function for displaying the elements in the streamlit app.
Args:
dstats (class): The dataset_statistics.py DatasetStatisticsCacheClass
display_list (list): List of tuples for (widget_name, widget_display_function)
show_perplexities (Bool): Whether perplexities should be loaded and displayed for this dataset
column_id (str): Which column of the dataset the analysis is done on [DEPRECATED for v1]
"""
# start showing stuff
gr_utils.expander_header(dstats, DATASET_NAME_TO_DICT)
for widget_tuple in display_list:
widget_type = widget_tuple[0]
widget_fn = widget_tuple[1]
logs.info("showing %s." % widget_type)
try:
widget_fn(dstats, column_id)
except Exception as e:
logs.warning("Jk jk jk. There was an issue with %s:" % widget_type)
logs.exception(e)
# TODO: Fix how this is a weird outlier.
if show_perplexities:
gr_utils.expander_text_perplexities(dstats, column_id)
logs.info("Have finished displaying the widgets.")