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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from typing import List
|
3 |
+
|
4 |
+
|
5 |
+
class Space:
|
6 |
+
def __init__(self, title, id):
|
7 |
+
self.title = title
|
8 |
+
self.id = id
|
9 |
+
|
10 |
+
|
11 |
+
class News:
|
12 |
+
def __init__(self, title, link):
|
13 |
+
self.title = title
|
14 |
+
self.link = link
|
15 |
+
|
16 |
+
|
17 |
+
class Category:
|
18 |
+
def __init__(self, title, description, news: List[News] = None, spaces=None):
|
19 |
+
if news is None:
|
20 |
+
news = []
|
21 |
+
|
22 |
+
if spaces is None:
|
23 |
+
spaces = []
|
24 |
+
|
25 |
+
self.title = title
|
26 |
+
self.description = description
|
27 |
+
self.news = news
|
28 |
+
self.spaces = spaces
|
29 |
+
|
30 |
+
|
31 |
+
inclusive = Category(
|
32 |
+
title="π§βπ€βπ§ Inclusive",
|
33 |
+
description="""
|
34 |
+
These are projects which broaden the scope of who _builds_ and _benefits_ in the machine learning world.
|
35 |
+
<br><br>
|
36 |
+
Examples of this can include:
|
37 |
+
<br><br>
|
38 |
+
- Curating diverse datasets that increase the representation of underserved groups
|
39 |
+
- Training language models on languages that aren't yet available on the Hugging Face Hub.
|
40 |
+
- Creating no-code and low-code frameworks that allow non-technical folk to engage with AI.
|
41 |
+
""",
|
42 |
+
news=[
|
43 |
+
News(
|
44 |
+
title="π Gradio 3.19 - Bugfixes and improved UI/UX for embedded apps",
|
45 |
+
link="https://twitter.com/Gradio/status/1627702506250805248"
|
46 |
+
),
|
47 |
+
News(
|
48 |
+
title="𧨠Diffusers 0.13 - New pipelines for editing and guiding models",
|
49 |
+
link="https://twitter.com/multimodalart/status/1627727910801928192"
|
50 |
+
)
|
51 |
+
],
|
52 |
+
spaces=[
|
53 |
+
Space(
|
54 |
+
title="Promptist Demo",
|
55 |
+
id="microsoft/Promptist"
|
56 |
+
),
|
57 |
+
Space(
|
58 |
+
title="MMTAfrica: Multilingual Machine Translation",
|
59 |
+
id="edaiofficial/mmtafrica"
|
60 |
+
),
|
61 |
+
Space(
|
62 |
+
title="Spanish to Quechua translation",
|
63 |
+
id="hackathon-pln-es/spanish-to-quechua-translation"
|
64 |
+
),
|
65 |
+
]
|
66 |
+
)
|
67 |
+
rigorous = Category(
|
68 |
+
title="βοΈ Rigorous",
|
69 |
+
description="""
|
70 |
+
Among the many concerns that go into creating new models is a seemingly simple question: "Does it work?"
|
71 |
+
<br><br>
|
72 |
+
Rigorous projects pay special attention to examining failure cases, protecting privacy through security measures, and ensuring that potential users (technical and non-technical) are informed of the project's limitations.
|
73 |
+
<br><br>
|
74 |
+
Examples:
|
75 |
+
<br><br>
|
76 |
+
- Projects built with models that are well-documented with Model Cards.
|
77 |
+
- Tools that provide transparency into how a model was trained and how it behaves.
|
78 |
+
- Evaluations against cutting-edge benchmarks, with results reported against disaggregated sets.
|
79 |
+
- Demonstrations of models failing across gender, skin type, ethnicity, age or other attributes.
|
80 |
+
- Techniques for mitigating issues like over-fitting and training data memorization.
|
81 |
+
""",
|
82 |
+
news=[
|
83 |
+
News(
|
84 |
+
title="ποΈ AI chatbots are coming to search engines β can you trust the results?",
|
85 |
+
link="https://www.nature.com/articles/d41586-023-00423-4"
|
86 |
+
),
|
87 |
+
News(
|
88 |
+
title="πͺͺ Model Cards: Introducing new documentation tools",
|
89 |
+
link="https://huggingface.co/blog/model-cards"
|
90 |
+
),
|
91 |
+
News(
|
92 |
+
title="Ethics & Society Newsletter #2: Let's talk about bias!",
|
93 |
+
link="https://huggingface.co/blog/ethics-soc-2"
|
94 |
+
)
|
95 |
+
],
|
96 |
+
spaces=[
|
97 |
+
Space(
|
98 |
+
title="A Watermark for Large Language Models",
|
99 |
+
id="tomg-group-umd/lm-watermarking"
|
100 |
+
),
|
101 |
+
Space(
|
102 |
+
title="Roots Search Tool",
|
103 |
+
id="bigscience-data/roots-search"
|
104 |
+
),
|
105 |
+
Space(
|
106 |
+
title="Diffusion Bias Explorer",
|
107 |
+
id="society-ethics/DiffusionBiasExplorer"
|
108 |
+
),
|
109 |
+
Space(
|
110 |
+
title="Disaggregators",
|
111 |
+
id="society-ethics/disaggregators"
|
112 |
+
)
|
113 |
+
]
|
114 |
+
)
|
115 |
+
socially_conscious = Category(
|
116 |
+
title="ποΈβπ¨οΈ Socially Conscious",
|
117 |
+
description="""
|
118 |
+
Socially Conscious work shows us how machine learning can be applied as a force for good!
|
119 |
+
<br><br>
|
120 |
+
Examples:
|
121 |
+
<br><br>
|
122 |
+
- Using machine learning as part of an effort to tackle climate change.
|
123 |
+
- Building tools to assist with medical research and practice.
|
124 |
+
- Models for text-to-speech, image captioning, and other tasks aimed at increasing accessibility.
|
125 |
+
- Creating systems for the digital humanities, such as for Indigenous language revitalization.
|
126 |
+
""",
|
127 |
+
news=[
|
128 |
+
News(
|
129 |
+
title="π¦ New dataset: LILA Camera Traps",
|
130 |
+
link="https://huggingface.co/datasets/society-ethics/lila_camera_traps"
|
131 |
+
),
|
132 |
+
News(
|
133 |
+
title="π§βπ¬ Deep Learning With Proteins",
|
134 |
+
link="https://huggingface.co/blog/deep-learning-with-proteins"
|
135 |
+
)
|
136 |
+
],
|
137 |
+
spaces=[
|
138 |
+
Space(
|
139 |
+
title="Comparing Captioning Models",
|
140 |
+
id="nielsr/comparing-captioning-models"
|
141 |
+
),
|
142 |
+
Space(
|
143 |
+
title="Whisper Speaker Diarization",
|
144 |
+
id="vumichien/whisper-speaker-diarization"
|
145 |
+
),
|
146 |
+
Space(
|
147 |
+
title="Speech Recognition from visual lip movement",
|
148 |
+
id="vumichien/lip_movement_reading"
|
149 |
+
),
|
150 |
+
Space(
|
151 |
+
title="Socratic Models Image Captioning",
|
152 |
+
id="Geonmo/socratic-models-image-captioning-with-BLOOM"
|
153 |
+
),
|
154 |
+
]
|
155 |
+
)
|
156 |
+
consentful = Category(
|
157 |
+
title="π€ Consentful",
|
158 |
+
description="""
|
159 |
+
[What is consentful tech?](https://www.consentfultech.io)
|
160 |
+
Consentful technology supports the self-determination of people who use and are affected by these technologies.
|
161 |
+
<br><br>
|
162 |
+
Examples of this can include:
|
163 |
+
<br><br>
|
164 |
+
- Demonstrating a commitment to acquiring data from willing, informed, and appropriately compensated sources.
|
165 |
+
- Designing systems that respect end-user autonomy, e.g. with privacy-preserving techniques.
|
166 |
+
- Avoiding extractive, chauvinist, ["dark"](https://www.deceptive.design), and otherwise "unethical" patterns of engagement.
|
167 |
+
""",
|
168 |
+
news=[
|
169 |
+
News(
|
170 |
+
title="The Stack - 3 TB of Permissively Licensed Source Code",
|
171 |
+
link="https://www.bigcode-project.org/docs/about/the-stack/"
|
172 |
+
)
|
173 |
+
],
|
174 |
+
spaces=[
|
175 |
+
Space(
|
176 |
+
title="Sentiment Analysis on Encrypted Data with FHE",
|
177 |
+
id="zama-fhe/encrypted_sentiment_analysis"
|
178 |
+
),
|
179 |
+
Space(
|
180 |
+
title="SantaCoder: Code Generation",
|
181 |
+
id="bigcode/santacoder-demo"
|
182 |
+
),
|
183 |
+
Space(
|
184 |
+
title="Data Anonymization in Autonomous Driving",
|
185 |
+
id="khaclinh/self-driving-anonymization"
|
186 |
+
),
|
187 |
+
Space(
|
188 |
+
title="Raising the Cost of Malicious AI-Powered Image Editing",
|
189 |
+
id="RamAnanth1/photoguard"
|
190 |
+
),
|
191 |
+
]
|
192 |
+
)
|
193 |
+
sustainable = Category(
|
194 |
+
title="π Sustainable",
|
195 |
+
description="""
|
196 |
+
These are Spaces that highlight and explore techniques for making machine learning ecologically sustainable.
|
197 |
+
<br><br>
|
198 |
+
Examples
|
199 |
+
<br><br>
|
200 |
+
- Tracking emissions from training and running inferences on large language models.
|
201 |
+
- Quantization and distillation methods to reduce carbon footprints without sacrificing model quality.
|
202 |
+
""",
|
203 |
+
news=[
|
204 |
+
News(
|
205 |
+
title="π New paper: Counting Carbon β Luccioni & Hernandez-Garcia, 2023",
|
206 |
+
link="https://twitter.com/SashaMTL/status/1626572394130292737"
|
207 |
+
),
|
208 |
+
News(
|
209 |
+
title="PEFT: Parameter-Efficient Fine-Tuning on Low-Resource Hardware",
|
210 |
+
link="https://huggingface.co/blog/peft"
|
211 |
+
)
|
212 |
+
],
|
213 |
+
spaces=[
|
214 |
+
Space(
|
215 |
+
title="Hugging Face Carbon Compare Tool",
|
216 |
+
id="huggingface/Carbon-Compare"
|
217 |
+
),
|
218 |
+
Space(
|
219 |
+
title="Image Classification with EfficientFormer-L1",
|
220 |
+
id="adirik/efficientformer"
|
221 |
+
),
|
222 |
+
Space(
|
223 |
+
title="EfficientNetV2 Deepfakes Video Detector",
|
224 |
+
id="Ron0420/EfficientNetV2_Deepfakes_Video_Detector"
|
225 |
+
),
|
226 |
+
]
|
227 |
+
)
|
228 |
+
inquisitive = Category(
|
229 |
+
title="π€ Inquisitive",
|
230 |
+
description="""
|
231 |
+
Some projects take a radical new approach to concepts which may have become commonplace. These projects, often rooted in critical theory, shine a light on inequities and power structures which challenge the community to rethink its relationship to technology.
|
232 |
+
<br><br>
|
233 |
+
Examples:
|
234 |
+
<br><br>
|
235 |
+
- Reframing AI and machine learning from Indigenous perspectives.
|
236 |
+
- Highlighting LGBTQIA2S+ marginalization in AI.
|
237 |
+
- Critiquing the harms perpetuated by AI systems.
|
238 |
+
- Discussing the role of "openness" in AI research.
|
239 |
+
""",
|
240 |
+
news=[
|
241 |
+
News(
|
242 |
+
title="π¦ DAIR's Stochastic Parrots Day is on March 17",
|
243 |
+
link="https://twitter.com/emilymbender/status/1627312284392640513"
|
244 |
+
),
|
245 |
+
News(
|
246 |
+
title="π New paper: The Gradient of Generative AI Release β Solaiman, 2023",
|
247 |
+
link="https://twitter.com/IreneSolaiman/status/1625158317378252800"
|
248 |
+
),
|
249 |
+
News(
|
250 |
+
title="βοΈ Diffusers has a brand new Ethical Guidelines doc!",
|
251 |
+
link="https://github.com/huggingface/diffusers/pull/2330"
|
252 |
+
)
|
253 |
+
],
|
254 |
+
spaces=[
|
255 |
+
Space(
|
256 |
+
title="Spanish Gender Neutralizer",
|
257 |
+
id="hackathon-pln-es/es_nlp_gender_neutralizer"
|
258 |
+
),
|
259 |
+
Space(
|
260 |
+
title="PAIR: Datasets Have Worldviews",
|
261 |
+
id="merve/dataset-worldviews"
|
262 |
+
),
|
263 |
+
|
264 |
+
]
|
265 |
+
)
|
266 |
+
|
267 |
+
categories = [rigorous, consentful, socially_conscious, sustainable, inclusive, inquisitive]
|
268 |
+
|
269 |
+
|
270 |
+
def news_card(news):
|
271 |
+
with gr.Box():
|
272 |
+
with gr.Row(elem_id="news-row"):
|
273 |
+
gr.Markdown(f"{news.title}")
|
274 |
+
button = gr.Button(elem_id="article-button", value="Read more π")
|
275 |
+
button.click(fn=None, _js=f"() => window.open('{news.link}')")
|
276 |
+
|
277 |
+
|
278 |
+
def space_card(space):
|
279 |
+
with gr.Box(elem_id="space-card"):
|
280 |
+
with gr.Row(elem_id="news-row"):
|
281 |
+
gr.Markdown(f"{space.title}")
|
282 |
+
button = gr.Button(elem_id="article-button", value="View π")
|
283 |
+
button.click(fn=None, _js=f"() => window.open('https://hf.space/{space.id}')")
|
284 |
+
|
285 |
+
|
286 |
+
def category_tab(category):
|
287 |
+
with gr.Tab(label=category.title, elem_id="news-tab"):
|
288 |
+
with gr.Row():
|
289 |
+
with gr.Column():
|
290 |
+
gr.Markdown(category.description, elem_id="margin-top")
|
291 |
+
with gr.Column():
|
292 |
+
gr.Markdown("### Hugging Face News π°")
|
293 |
+
[news_card(x) for x in category.news]
|
294 |
+
with gr.Tab(label="Spaces"):
|
295 |
+
with gr.Row(elem_id="spaces-flex"):
|
296 |
+
[space_card(x) for x in category.spaces]
|
297 |
+
with gr.Tab(label="Models - Coming Soon!"):
|
298 |
+
gr.Markdown("#### Check back soon for featured models π€")
|
299 |
+
with gr.Tab(label="Datasets - Coming Soon!"):
|
300 |
+
gr.Markdown("#### Check back soon for featured datasets π€")
|
301 |
+
|
302 |
+
|
303 |
+
with gr.Blocks(css="#margin-top {margin-top: 15px} #center {text-align: center;} #news-tab {padding: 15px;} #news-tab h3 {margin: 0px; text-align: center;} #news-tab p {margin: 0px;} #article-button {flex-grow: initial;} #news-row {align-items: center;} #spaces-flex {flex-wrap: wrap;} #space-card { display: flex; min-width: calc(90% / 3); max-width:calc(100% / 3); box-sizing: border-box;}") as demo:
|
304 |
+
with gr.Row(elem_id="center"):
|
305 |
+
gr.Markdown("# Ethics & Society at Hugging Face")
|
306 |
+
|
307 |
+
gr.Markdown("""
|
308 |
+
At Hugging Face, we are committed to operationalizing ethics at the cutting-edge of machine learning. This page is dedicated to highlighting projects β inside and outside Hugging Face β in order to encourage and support ethical AI. We wish to have an ongoing conversation when it comes to ethics; this means that this page will evolve over time, and your feedback is invaluable. Please open up an issue in the [Community tab](https://huggingface.co/docs/hub/repositories-pull-requests-discussions) to share your thoughts!
|
309 |
+
""")
|
310 |
+
|
311 |
+
with gr.Accordion(label="Want to learn more? Visit us over on the Hugging Face Discord!", open=False):
|
312 |
+
gr.Markdown("""
|
313 |
+
Follow these steps to join the discussion:
|
314 |
+
|
315 |
+
1. Go to [hf.co/join/discord](https://hf.co/join/discord) to join the Discord server.
|
316 |
+
2. Once you've registered, go to the `#role-assignment` channel.
|
317 |
+
3. Select the "Open Science" role.
|
318 |
+
4. Head over to `#ethics-and-society` to join the conversation π₯³
|
319 |
+
""", elem_id="margin-top")
|
320 |
+
|
321 |
+
gr.Markdown("""
|
322 |
+
### What does ethical AI look like?
|
323 |
+
|
324 |
+
We analyzed the submissions on Hugging Face Spaces and put together a set of 6 high-level categories for describing ethical machine learning work. Visit each tab to learn more about each category and to see what Hugging Face and its community have been up to!
|
325 |
+
""")
|
326 |
+
|
327 |
+
with gr.Column():
|
328 |
+
[category_tab(x) for x in categories]
|
329 |
+
|
330 |
+
demo.launch()
|