File size: 593 Bytes
e931b70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st


def display(dataframe, columns_=None, index=None):
    if len(dataframe) > 0:
        if index:
            dataframe.set_index(index)
        if columns_:
            st.dataframe(dataframe[columns_])
        else:
            st.dataframe(dataframe)
    else:
        st.write(
            "Sorry 😡 we didn't find any articles related to your query.\n\n"
            "Maybe the LLM is too naughty that does not follow our instruction... \n\n"
            "Please try again and use verbs that may match the datatype.",
            unsafe_allow_html=True
        )