Spaces:
Runtime error
Runtime error
sashavor
commited on
Commit
·
eda3176
1
Parent(s):
419df8a
changing input
Browse files
app.py
CHANGED
@@ -88,7 +88,7 @@ with st.expander("Calculate the dynamic emissions of your model"):
|
|
88 |
gpu_tdp = TDP['tdp_watts'][TDP['name'] == hardware].tolist()[0]
|
89 |
st.markdown("Different hardware has different TDP (Thermal Design Power), which impacts how much energy you use.")
|
90 |
with col2:
|
91 |
-
num_gpus = st.
|
92 |
#st.markdown('This is calculated by multiplying the number of GPUs you used by the training time: '
|
93 |
# 'i.e. if you used 100 GPUs for 10 hours, this is equal to 100x10 = 1,000 GPU hours.')
|
94 |
with col3:
|
@@ -106,7 +106,7 @@ with st.expander("Calculate the dynamic emissions of your model"):
|
|
106 |
carbon_intensity = st.number_input('Carbon intensity of your energy grid, in grams of CO2 per kWh')
|
107 |
st.markdown('You can consult a resource like the [IEA](https://www.iea.org/countries) or '
|
108 |
' [Electricity Map](https://app.electricitymaps.com/) to get this information.')
|
109 |
-
dynamic_emissions = round(gpu_tdp * num_gpus*training_time * carbon_intensity/1000000)
|
110 |
st.metric(label="Dynamic emissions", value=str(dynamic_emissions)+' kilograms of CO2eq')
|
111 |
st.markdown('This is roughly equivalent to '+ str(round(dynamic_emissions/kg_per_mile,1)) + ' miles driven in an average US car'
|
112 |
' produced in 2021. [(Source: energy.gov)](https://www.energy.gov/eere/vehicles/articles/fotw-1223-january-31-2022-average-carbon-dioxide-emissions-2021-model-year)')
|
|
|
88 |
gpu_tdp = TDP['tdp_watts'][TDP['name'] == hardware].tolist()[0]
|
89 |
st.markdown("Different hardware has different TDP (Thermal Design Power), which impacts how much energy you use.")
|
90 |
with col2:
|
91 |
+
num_gpus = st.text_input('Number of GPUs/CPUs/TPUs used', value = 16)
|
92 |
#st.markdown('This is calculated by multiplying the number of GPUs you used by the training time: '
|
93 |
# 'i.e. if you used 100 GPUs for 10 hours, this is equal to 100x10 = 1,000 GPU hours.')
|
94 |
with col3:
|
|
|
106 |
carbon_intensity = st.number_input('Carbon intensity of your energy grid, in grams of CO2 per kWh')
|
107 |
st.markdown('You can consult a resource like the [IEA](https://www.iea.org/countries) or '
|
108 |
' [Electricity Map](https://app.electricitymaps.com/) to get this information.')
|
109 |
+
dynamic_emissions = round(gpu_tdp * float(num_gpus)*training_time * carbon_intensity/1000000)
|
110 |
st.metric(label="Dynamic emissions", value=str(dynamic_emissions)+' kilograms of CO2eq')
|
111 |
st.markdown('This is roughly equivalent to '+ str(round(dynamic_emissions/kg_per_mile,1)) + ' miles driven in an average US car'
|
112 |
' produced in 2021. [(Source: energy.gov)](https://www.energy.gov/eere/vehicles/articles/fotw-1223-january-31-2022-average-carbon-dioxide-emissions-2021-model-year)')
|