mariagrandury
commited on
Commit
•
441e512
1
Parent(s):
84fba5a
feat: create blocks to add intro, instructions and comparison graphics
Browse files
app.py
CHANGED
@@ -40,6 +40,7 @@ dataset = load_dataset("mariagrandury/fmti-indicators")
|
|
40 |
df = pd.DataFrame(dataset["train"])
|
41 |
grouped = df.groupby(["Domain", "Subdomain"])
|
42 |
|
|
|
43 |
# Create an interface per group of indicators
|
44 |
interfaces = []
|
45 |
tab_names = []
|
@@ -57,6 +58,7 @@ for (domain, subdomain), group in grouped:
|
|
57 |
interfaces.append(iface)
|
58 |
tab_names.append(subdomain)
|
59 |
|
|
|
60 |
# Add overall percentage button
|
61 |
overall_button = gr.Interface(
|
62 |
fn=calculate_overall_percentage,
|
@@ -68,10 +70,60 @@ overall_button = gr.Interface(
|
|
68 |
interfaces.append(overall_button)
|
69 |
tab_names.append("Total Transparency Score")
|
70 |
|
|
|
71 |
# Create the tabbed interface
|
72 |
tabbed_interface = gr.TabbedInterface(
|
73 |
interface_list=interfaces,
|
74 |
tab_names=tab_names,
|
75 |
title="The Foundation Model Transparency Index",
|
76 |
)
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
df = pd.DataFrame(dataset["train"])
|
41 |
grouped = df.groupby(["Domain", "Subdomain"])
|
42 |
|
43 |
+
|
44 |
# Create an interface per group of indicators
|
45 |
interfaces = []
|
46 |
tab_names = []
|
|
|
58 |
interfaces.append(iface)
|
59 |
tab_names.append(subdomain)
|
60 |
|
61 |
+
|
62 |
# Add overall percentage button
|
63 |
overall_button = gr.Interface(
|
64 |
fn=calculate_overall_percentage,
|
|
|
70 |
interfaces.append(overall_button)
|
71 |
tab_names.append("Total Transparency Score")
|
72 |
|
73 |
+
|
74 |
# Create the tabbed interface
|
75 |
tabbed_interface = gr.TabbedInterface(
|
76 |
interface_list=interfaces,
|
77 |
tab_names=tab_names,
|
78 |
title="The Foundation Model Transparency Index",
|
79 |
)
|
80 |
+
|
81 |
+
|
82 |
+
# Combine blocks to create demo
|
83 |
+
with gr.Blocks(title="FMTI") as demo:
|
84 |
+
gr.Markdown(
|
85 |
+
"""
|
86 |
+
# Transparency Self-Assessment (FMTI)
|
87 |
+
|
88 |
+
This tool allows you to self-assess the transparency of your model based on the Foundation Model Transparency Index developed by the Center for Research on Foundation Models.
|
89 |
+
"""
|
90 |
+
)
|
91 |
+
with gr.Accordion(label="Instructions", open=True):
|
92 |
+
gr.Markdown(
|
93 |
+
"""
|
94 |
+
The FMTI defines 100 indicators that characterize transparency for foundation model developers. They are divided into three broad domains: "Upstream" (model building), "Model" (model properties and function) and "Downstream" (model distribution). In addition to these top-level domains, the indicators are also grouped together into subdomains.
|
95 |
+
|
96 |
+
Each tab below contains yes-or-no questions for each subdomain. Read all questions and check the boxes corresponding to the 'yes' responses. "Submit" your answers before proceeding to the next tab. Upon reaching the final tab, "Total Transparency Score", click on "Generate" to compute your model's overall transparency score.
|
97 |
+
|
98 |
+
More info about the FMTI at https://crfm.stanford.edu/fmti/.
|
99 |
+
|
100 |
+
Please note: this tool is research work and NOT a commercial or legal product.
|
101 |
+
"""
|
102 |
+
)
|
103 |
+
gr.TabbedInterface(
|
104 |
+
interface_list=interfaces,
|
105 |
+
tab_names=tab_names,
|
106 |
+
title="",
|
107 |
+
)
|
108 |
+
gr.Markdown(
|
109 |
+
"""
|
110 |
+
## Compare your results
|
111 |
+
|
112 |
+
How transparent is your model compared to the ones in the 2023 study? Check the graphics below!
|
113 |
+
|
114 |
+
Images source: https://crfm.stanford.edu/fmti
|
115 |
+
"""
|
116 |
+
)
|
117 |
+
with gr.Row():
|
118 |
+
gr.Image(
|
119 |
+
"https://crfm.stanford.edu/fmti/fmti-flagship.jpg",
|
120 |
+
show_label=False,
|
121 |
+
show_download_button=False,
|
122 |
+
)
|
123 |
+
gr.Image(
|
124 |
+
"https://crfm.stanford.edu/fmti/subdomain-scores.png",
|
125 |
+
show_label=False,
|
126 |
+
show_download_button=False,
|
127 |
+
)
|
128 |
+
|
129 |
+
demo.launch()
|