added company mode
Browse files- src/company.py +22 -23
src/company.py
CHANGED
|
@@ -89,31 +89,30 @@ def company_mode():
|
|
| 89 |
|
| 90 |
company_multiplier = company_size * use_percentage/100 * request_frequency
|
| 91 |
|
| 92 |
-
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
-
#down here
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
| 89 |
|
| 90 |
company_multiplier = company_size * use_percentage/100 * request_frequency
|
| 91 |
|
| 92 |
+
try:
|
| 93 |
|
| 94 |
+
impacts = llm_impacts(
|
| 95 |
+
provider=provider_raw,
|
| 96 |
+
model_name=model_raw,
|
| 97 |
+
output_token_count=[x[1] for x in PROMPTS if x[0] == output_tokens][0],
|
| 98 |
+
request_latency=100000
|
| 99 |
+
)
|
| 100 |
|
| 101 |
+
impacts, _, _ = format_impacts(impacts)
|
| 102 |
|
|
|
|
| 103 |
|
| 104 |
+
|
| 105 |
+
with st.container(border=True):
|
| 106 |
|
| 107 |
+
st.markdown('<h3 align = "center">Environmental impacts</h3>', unsafe_allow_html=True)
|
| 108 |
+
st.markdown('<p align = "center">To understand how the environmental impacts are computed go to the ๐ Methodology tab.</p>', unsafe_allow_html=True)
|
| 109 |
+
display_impacts_company(impacts, provider, company_multiplier, location="๐ World")
|
| 110 |
+
|
| 111 |
+
with st.container(border=True):
|
| 112 |
+
#TODO : corriger รงa
|
| 113 |
+
st.markdown('<h3 align = "center">That\'s equivalent to ...</h3>', unsafe_allow_html=True)
|
| 114 |
+
st.markdown('<p align = "center">On the scale of the company, making this request to the LLM over a day is equivalent to the following actions :</p>', unsafe_allow_html=True)
|
| 115 |
+
display_equivalent_company(impacts, provider, company_multiplier, location="๐ World")
|
| 116 |
+
|
| 117 |
+
except Exception as e:
|
| 118 |
+
st.error('Could not find the model in the repository. Please try another model.')
|