Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ class DataList:
|
|
| 59 |
@staticmethod
|
| 60 |
def filter_table(df: pd.DataFrame, filter_names: list[str], filter_names2: list[str]) -> pd.DataFrame:
|
| 61 |
df = df.loc[df.Module.isin(set(filter_names))]
|
| 62 |
-
df= df[df.
|
| 63 |
return df
|
| 64 |
|
| 65 |
@staticmethod
|
|
@@ -97,7 +97,7 @@ span.svelte-s1r2yt{font-weight: bold !important;
|
|
| 97 |
with gr.Blocks(css=css) as demo:
|
| 98 |
search_box = gr.Textbox( label='Search Name', placeholder='You can search for titles with regular expressions. e.g. (?<!sur)face',max_lines=1, scale = 5)
|
| 99 |
filter_names = gr.CheckboxGroup(choices=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], value=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], label='Type')
|
| 100 |
-
filter_names2 = gr.CheckboxGroup(choices=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], value=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], label='
|
| 101 |
search_button = gr.Button('Search', size = 'sm', scale =1)
|
| 102 |
table = gr.HTML(show_label=False)
|
| 103 |
|
|
|
|
| 59 |
@staticmethod
|
| 60 |
def filter_table(df: pd.DataFrame, filter_names: list[str], filter_names2: list[str]) -> pd.DataFrame:
|
| 61 |
df = df.loc[df.Module.isin(set(filter_names))]
|
| 62 |
+
df= df[df.Type.str.contains('|'.join(filter_names2),case=False, regex=True)]
|
| 63 |
return df
|
| 64 |
|
| 65 |
@staticmethod
|
|
|
|
| 97 |
with gr.Blocks(css=css) as demo:
|
| 98 |
search_box = gr.Textbox( label='Search Name', placeholder='You can search for titles with regular expressions. e.g. (?<!sur)face',max_lines=1, scale = 5)
|
| 99 |
filter_names = gr.CheckboxGroup(choices=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], value=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], label='Type')
|
| 100 |
+
filter_names2 = gr.CheckboxGroup(choices=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], value=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], label='Type (Formate)')
|
| 101 |
search_button = gr.Button('Search', size = 'sm', scale =1)
|
| 102 |
table = gr.HTML(show_label=False)
|
| 103 |
|