samuelrince commited on
Commit
9f104ef
1 Parent(s): d76aa86

feat: add warning on closed source models

Browse files
Files changed (4) hide show
  1. app.py +8 -1
  2. src/assets.py +11 -0
  3. src/constants.py +17 -0
  4. src/content.py +10 -0
app.py CHANGED
@@ -22,7 +22,8 @@ from src.constants import (
22
  META_MODELS,
23
  MISTRALAI_MODELS,
24
  PROMPTS,
25
- MODELS
 
26
  )
27
  from src.utils import (
28
  format_impacts,
@@ -144,6 +145,12 @@ with gr.Blocks(css=custom_css) as demo:
144
 
145
  # Inference impacts
146
  with gr.Blocks():
 
 
 
 
 
 
147
  with gr.Row():
148
  gr.Markdown("""
149
  ## Environmental impacts
 
22
  META_MODELS,
23
  MISTRALAI_MODELS,
24
  PROMPTS,
25
+ CLOSED_SOURCE_MODELS,
26
+ MODELS,
27
  )
28
  from src.utils import (
29
  format_impacts,
 
145
 
146
  # Inference impacts
147
  with gr.Blocks():
148
+ if f"{provider}/{model}" in CLOSED_SOURCE_MODELS:
149
+ with gr.Row():
150
+ gr.Markdown("""<p> ⚠️ You've selected a closed-source model; be aware that the impact's
151
+ precision is low due to a lack of transparency from the provider. (see FAQ in About)
152
+ </p>""", elem_classes="warning-box")
153
+
154
  with gr.Row():
155
  gr.Markdown("""
156
  ## Environmental impacts
src/assets.py CHANGED
@@ -3,4 +3,15 @@ custom_css = """
3
  .descriptive-text span {
4
  font-size: 16px !important;
5
  }
 
 
 
 
 
 
 
 
 
 
 
6
  """
 
3
  .descriptive-text span {
4
  font-size: 16px !important;
5
  }
6
+
7
+
8
+ .warning-box p {
9
+ background-color: #ff91001a;
10
+ border: 1px solid #f19637;
11
+ border-radius: 8px;
12
+ padding: 4px 8px;
13
+ margin: 0px 8px;
14
+ font-size: 14px !important;
15
+ font-weight: bold !important;
16
+ }
17
  """
src/constants.py CHANGED
@@ -56,6 +56,23 @@ PROMPTS = [
56
  ]
57
  PROMPTS = [(s + f" ({v} output tokens)", v) for (s, v) in PROMPTS]
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  MODELS = [
60
  ("OpenAI / GPT-4o", "openai/gpt-4o"),
61
  ("OpenAI / GPT-4-Turbo", "openai/gpt-4-turbo"),
 
56
  ]
57
  PROMPTS = [(s + f" ({v} output tokens)", v) for (s, v) in PROMPTS]
58
 
59
+ CLOSED_SOURCE_MODELS = {
60
+ "openai/gpt-4o",
61
+ "openai/gpt-4-turbo",
62
+ "openai/gpt-4",
63
+ "openai/gpt-3.5-turbo",
64
+ "anthropic/claude-3-opus-20240229",
65
+ "anthropic/claude-3-sonnet-20240229",
66
+ "anthropic/claude-3-haiku-20240307",
67
+ "anthropic/claude-2.1",
68
+ "anthropic/claude-2.0",
69
+ "anthropic/claude-instant-1.2",
70
+ "mistralai/mistral-tiny-2312",
71
+ "mistralai/mistral-small-2402",
72
+ "mistralai/mistral-medium-2312",
73
+ "mistralai/mistral-large-2402",
74
+ }
75
+
76
  MODELS = [
77
  ("OpenAI / GPT-4o", "openai/gpt-4o"),
78
  ("OpenAI / GPT-4-Turbo", "openai/gpt-4-turbo"),
src/content.py CHANGED
@@ -39,6 +39,16 @@ the energy consumption and environmental footprint of using generative AI models
39
 
40
  ## 🙋 FAQ
41
 
 
 
 
 
 
 
 
 
 
 
42
  **Which generative AI models or providers are supported?**
43
 
44
  To see the full list of **generative AI providers** currently supported by EcoLogits, see the following
 
39
 
40
  ## 🙋 FAQ
41
 
42
+ **How we assess the impacts of closed-source models?**
43
+
44
+ Environmental impacts are calculated based on model architecture and parameter count. For closed-source models, we
45
+ lack transparency from providers, so we estimate parameter counts using available information. For GPT models, we
46
+ based our estimates on leaked GPT-4 architecture and scaled parameters count for GPT-4-Turbo and GPT-4o based on
47
+ pricing differences. For other proprietary models like Anthropic's Claude, we assume similar impacts for models
48
+ released around the same time with similar performance on public benchmarks. Please note that these estimates are
49
+ based on assumptions and may not be exact. Our methods are open-source and transparent so you can always see the
50
+ hypotheses we use.
51
+
52
  **Which generative AI models or providers are supported?**
53
 
54
  To see the full list of **generative AI providers** currently supported by EcoLogits, see the following