yjernite commited on
Commit
674a598
·
1 Parent(s): 7ca5c60

remove extraneous stuff

Browse files
Files changed (1) hide show
  1. app.py +0 -42
app.py CHANGED
@@ -7,15 +7,6 @@ pd.options.plotting.backend = "plotly"
7
 
8
 
9
  TITLE = "Diffusion Faces Cluster Explorer"
10
- clusters_12 = pd.read_json("clusters/professions_to_clusters_12.json")
11
- clusters_24 = pd.read_json("clusters/professions_to_clusters_24.json")
12
- clusters_48 = pd.read_json("clusters/professions_to_clusters_48.json")
13
-
14
- clusters_by_size = {
15
- 12: clusters_12,
16
- 24: clusters_24,
17
- 48: clusters_48,
18
- }
19
 
20
  clusters_dicts = dict(
21
  (num_cl, json.load(open(f"clusters/professions_to_clusters_{num_cl}.json")))
@@ -81,9 +72,6 @@ def make_profession_table(num_clusters, prof_names, mod_name, max_cols=8):
81
  )
82
  for prof_name in prof_names
83
  ]
84
- from pprint import pprint
85
-
86
- pprint(professions_list_clusters)
87
  totals = sorted(
88
  [
89
  (
@@ -121,7 +109,6 @@ def make_profession_table(num_clusters, prof_names, mod_name, max_cols=8):
121
  for prof_name, prof_clusters in professions_list_clusters
122
  ]
123
  clusters_df = pd.DataFrame.from_dict(prof_list_pre_pandas)
124
- print("I'm fine")
125
  return (
126
  clusters_df.style.background_gradient(
127
  axis=None, vmin=0, vmax=100, cmap="YlGnBu"
@@ -131,35 +118,6 @@ def make_profession_table(num_clusters, prof_names, mod_name, max_cols=8):
131
  )
132
 
133
 
134
- def make_profession_table_df(num_clusters, prof_names, mod_name):
135
- cl_df = clusters_by_size[num_clusters]
136
- clusters_df = (
137
- cl_df[df_models[mod_name]]
138
- .apply(pd.Series)
139
- .loc[prof_names]["cluster_proportions"]
140
- .apply(pd.Series)
141
- .reset_index()
142
- .rename(columns={"index": "profession"})
143
- .round(1)
144
- )
145
- labor_df = (
146
- cl_df[df_models[mod_name]]
147
- .apply(pd.Series)
148
- .loc[prof_names]["labor_fm"]
149
- .apply(pd.Series)
150
- .rename(columns={0: "woman", 1: "male"})
151
- .reset_index()
152
- .rename(columns={"index": "profession"})
153
- .round(1)
154
- )
155
- return (
156
- clusters_df.style.background_gradient(cmap="YlGnBu").format(precision=1),
157
- labor_df.style.background_gradient(cmap="coolwarm").to_html(),
158
- )
159
-
160
-
161
- # return clusters_df.style.background_gradient(axis=None, vmin=0, vmax=100, cmap="YlGnBu").format(precision=1), labor_df.style.background_gradient(cmap='coolwarm').to_html()
162
-
163
 
164
  with gr.Blocks() as demo:
165
  gr.Markdown("# 🤗 Diffusion Cluster Explorer")
 
7
 
8
 
9
  TITLE = "Diffusion Faces Cluster Explorer"
 
 
 
 
 
 
 
 
 
10
 
11
  clusters_dicts = dict(
12
  (num_cl, json.load(open(f"clusters/professions_to_clusters_{num_cl}.json")))
 
72
  )
73
  for prof_name in prof_names
74
  ]
 
 
 
75
  totals = sorted(
76
  [
77
  (
 
109
  for prof_name, prof_clusters in professions_list_clusters
110
  ]
111
  clusters_df = pd.DataFrame.from_dict(prof_list_pre_pandas)
 
112
  return (
113
  clusters_df.style.background_gradient(
114
  axis=None, vmin=0, vmax=100, cmap="YlGnBu"
 
118
  )
119
 
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  with gr.Blocks() as demo:
123
  gr.Markdown("# 🤗 Diffusion Cluster Explorer")