sasha HF Staff commited on
Commit
769fd81
·
1 Parent(s): 0913327

trying this

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -16,15 +16,18 @@ organizations=['Alphabet', 'OpenAI', 'Alibaba', 'Stanford University', 'Universi
16
  'Carnegie Mellon University (CMU)', 'University of Oxford','University of California (UC) Berkeley','Baidu','Anthropic',
17
  'Salesforce Research', 'Amazon', 'University of Montreal', 'Apple', 'Mistral AI', 'DeepSeek', 'Allen Institute for AI']
18
 
19
-
20
- fig = px.histogram(data, x="Year", color="Environmental Transparency")
 
 
21
 
22
  with gr.Blocks() as demo:
23
  gr.Markdown("# Environmental Transparency Explorer Tool")
24
  gr.Markdown("## Explore the data from 'Misinformation by Omission: The Need for More Environmental Transparency in AI'")
25
  with gr.Row():
26
  with gr.Column(scale=1):
27
- gr.Dropdown(organizations, label="Organizations", info="Pick an organization to explore their environmental disclosures", interactive=True)
 
28
  with gr.Column(scale=4):
29
  gr.Plot(fig)
30
 
 
16
  'Carnegie Mellon University (CMU)', 'University of Oxford','University of California (UC) Berkeley','Baidu','Anthropic',
17
  'Salesforce Research', 'Amazon', 'University of Montreal', 'Apple', 'Mistral AI', 'DeepSeek', 'Allen Institute for AI']
18
 
19
+ def generate_figure(org_name):
20
+ org_data = data[data['Organization'] == org_name]
21
+ fig = px.histogram(org_data, x="Year", color="Environmental Transparency")
22
+ return fig
23
 
24
  with gr.Blocks() as demo:
25
  gr.Markdown("# Environmental Transparency Explorer Tool")
26
  gr.Markdown("## Explore the data from 'Misinformation by Omission: The Need for More Environmental Transparency in AI'")
27
  with gr.Row():
28
  with gr.Column(scale=1):
29
+ org_choice= gr.Dropdown(organizations, default="Alphabet", label="Organizations", info="Pick an organization to explore their environmental disclosures", interactive=True)
30
+ org_choice.select(generate_figure, inputs=org_choice, outputs=fig)
31
  with gr.Column(scale=4):
32
  gr.Plot(fig)
33