Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,20 @@ import gradio as gr
|
|
2 |
from datasets import load_dataset
|
3 |
import numpy as np
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
index = np.load("indexes/knn_10752_65.npy")
|
6 |
ds = load_dataset("SDBiaseval/identities", split="train")
|
7 |
|
|
|
|
|
|
|
8 |
def get_nearest_64(ix):
|
9 |
return ds.select(index[ix][1:])
|
|
|
|
2 |
from datasets import load_dataset
|
3 |
import numpy as np
|
4 |
|
5 |
+
gender_labels = ['man', 'no_gender_specified', 'non-binary', 'woman']
|
6 |
+
|
7 |
+
ethnicity_labels = ['African-American', 'American_Indian', 'Black', 'Caucasian', 'East_Asian',
|
8 |
+
'First_Nations', 'Hispanic', 'Indigenous_American', 'Latino', 'Latinx',
|
9 |
+
'Multiracial', 'Native_American', 'Pacific_Islander', 'South_Asian',
|
10 |
+
'Southeast_Asian', 'White', 'no_ethnicity_specified']
|
11 |
+
models = ['DallE', 'SD_14', 'SD_2']
|
12 |
+
|
13 |
index = np.load("indexes/knn_10752_65.npy")
|
14 |
ds = load_dataset("SDBiaseval/identities", split="train")
|
15 |
|
16 |
+
def get_index(gender, ethnicity, model, no):
|
17 |
+
pass
|
18 |
+
|
19 |
def get_nearest_64(ix):
|
20 |
return ds.select(index[ix][1:])
|
21 |
+
|