zseid
commited on
Commit
•
5c44a55
1
Parent(s):
62c99c3
add initial dropdown values to avoid prompt box bug
Browse files
app.py
CHANGED
@@ -183,19 +183,19 @@ if __name__=='__main__':
|
|
183 |
inp = gr.Textbox(label="Prompt",placeholder="Try selecting a prompt or enter your own",)
|
184 |
gr.Markdown("If the above component is stuck, try switching between the dropdown options.")
|
185 |
with gr.Tab("Trait/Sentiment"):
|
186 |
-
sent = gr.Dropdown(LOOKS,label="Trait")
|
187 |
gr.Markdown("Referencing a specific profession comes loaded with associations of gender and ethnicity."
|
188 |
" Text to image models provide an opportunity to explicitly specify an underrepresented group, but first we must understand our default behavior. "
|
189 |
"To view how mentioning a particular occupation affects the gender and skin colors in faces of text to image generators, select a job. Promotional materials,"
|
190 |
" advertising, and even criminal sketches which do not explicitly specify a gender or ethnicity term will tend towards the distributions in the Model Audit tab.")
|
191 |
-
sent.change(fn=lambda k: f"a {k} person photorealistic", inputs=sent, outputs=inp)
|
192 |
with gr.Tab("Occupation/Income"):
|
193 |
-
occs = gr.Dropdown(JOBS,label="Occupation")
|
194 |
gr.Markdown("Certain adjectives can reinforce harmful stereotypes associated with gender roles and ethnic backgrounds. "
|
195 |
"Text to image models provide an opportunity to understand how prompting a particular human expression could be triggering, "
|
196 |
"or why an uncommon combination might provide important examples to minorities without default representation."
|
197 |
"To view how positive, neutral, and negative words affect the gender and skin colors in the faces generated, select an adjective.")
|
198 |
-
occs.change(fn=lambda k: f"a {k} photorealistic", inputs=occs, outputs=inp, )
|
199 |
btn = gr.Button("Generate and Analyze")
|
200 |
with gr.Column():
|
201 |
|
|
|
183 |
inp = gr.Textbox(label="Prompt",placeholder="Try selecting a prompt or enter your own",)
|
184 |
gr.Markdown("If the above component is stuck, try switching between the dropdown options.")
|
185 |
with gr.Tab("Trait/Sentiment"):
|
186 |
+
sent = gr.Dropdown(LOOKS,label="Trait",value=LOOKS[0])
|
187 |
gr.Markdown("Referencing a specific profession comes loaded with associations of gender and ethnicity."
|
188 |
" Text to image models provide an opportunity to explicitly specify an underrepresented group, but first we must understand our default behavior. "
|
189 |
"To view how mentioning a particular occupation affects the gender and skin colors in faces of text to image generators, select a job. Promotional materials,"
|
190 |
" advertising, and even criminal sketches which do not explicitly specify a gender or ethnicity term will tend towards the distributions in the Model Audit tab.")
|
191 |
+
sent.change(fn=lambda k: f"a {k} person photorealistic", inputs=sent, outputs=[inp])
|
192 |
with gr.Tab("Occupation/Income"):
|
193 |
+
occs = gr.Dropdown(JOBS,label="Occupation",value=JOBS[0])
|
194 |
gr.Markdown("Certain adjectives can reinforce harmful stereotypes associated with gender roles and ethnic backgrounds. "
|
195 |
"Text to image models provide an opportunity to understand how prompting a particular human expression could be triggering, "
|
196 |
"or why an uncommon combination might provide important examples to minorities without default representation."
|
197 |
"To view how positive, neutral, and negative words affect the gender and skin colors in the faces generated, select an adjective.")
|
198 |
+
occs.change(fn=lambda k: f"a {k} photorealistic", inputs=occs, outputs=[inp], )
|
199 |
btn = gr.Button("Generate and Analyze")
|
200 |
with gr.Column():
|
201 |
|