Commit
ยท
7825e11
1
Parent(s):
a7e707d
refactor: change location selection for expert mode
Browse files- src/electricity_mix.py +2 -2
- src/expert.py +16 -12
src/electricity_mix.py
CHANGED
|
@@ -5,6 +5,7 @@ import pandas as pd
|
|
| 5 |
|
| 6 |
PATH = "src/data/electricity_mix.csv"
|
| 7 |
COUNTRY_CODES = [
|
|
|
|
| 8 |
("๐ฆ๐บ Australia", "AUS"),
|
| 9 |
("๐ฆ๐น Austria", "AUT"),
|
| 10 |
("๐ฆ๐ท Argentina", "ARG"),
|
|
@@ -53,8 +54,7 @@ COUNTRY_CODES = [
|
|
| 53 |
("๐น๐ญ Thailand", "THA"),
|
| 54 |
("๐น๐ท Turkey", "TUR"),
|
| 55 |
("๐น๐ผ Taiwan", "TWN"),
|
| 56 |
-
("๐บ๐ธ United States", "USA")
|
| 57 |
-
("๐ World", "WOR"),
|
| 58 |
]
|
| 59 |
|
| 60 |
CRITERIA = {
|
|
|
|
| 5 |
|
| 6 |
PATH = "src/data/electricity_mix.csv"
|
| 7 |
COUNTRY_CODES = [
|
| 8 |
+
("๐ World", "WOR"),
|
| 9 |
("๐ฆ๐บ Australia", "AUS"),
|
| 10 |
("๐ฆ๐น Austria", "AUT"),
|
| 11 |
("๐ฆ๐ท Argentina", "ARG"),
|
|
|
|
| 54 |
("๐น๐ญ Thailand", "THA"),
|
| 55 |
("๐น๐ท Turkey", "TUR"),
|
| 56 |
("๐น๐ผ Taiwan", "TWN"),
|
| 57 |
+
("๐บ๐ธ United States", "USA")
|
|
|
|
| 58 |
]
|
| 59 |
|
| 60 |
CRITERIA = {
|
src/expert.py
CHANGED
|
@@ -20,11 +20,11 @@ def expert_mode():
|
|
| 20 |
|
| 21 |
########## Model info ##########
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
df = load_models(filter_main=True)
|
| 26 |
|
| 27 |
-
with
|
| 28 |
provider_exp = st.selectbox(
|
| 29 |
label="Provider",
|
| 30 |
options=[x for x in df["provider_clean"].unique()],
|
|
@@ -32,7 +32,7 @@ def expert_mode():
|
|
| 32 |
key=1,
|
| 33 |
)
|
| 34 |
|
| 35 |
-
with
|
| 36 |
model_exp = st.selectbox(
|
| 37 |
label="Model",
|
| 38 |
options=[
|
|
@@ -72,14 +72,14 @@ def expert_mode():
|
|
| 72 |
|
| 73 |
########## Model parameters ##########
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
-
with
|
| 78 |
active_params = st.number_input(
|
| 79 |
"Active parameters (B)", 0, None, active_params
|
| 80 |
)
|
| 81 |
|
| 82 |
-
with
|
| 83 |
total_params = st.number_input(
|
| 84 |
"Total parameters (B)", 0, None, total_params
|
| 85 |
)
|
|
@@ -88,14 +88,14 @@ def expert_mode():
|
|
| 88 |
with st.container(border=True):
|
| 89 |
st.markdown("###### Configure the prompt")
|
| 90 |
|
| 91 |
-
|
| 92 |
|
| 93 |
-
with
|
| 94 |
output_tokens_exp = st.selectbox(
|
| 95 |
label="Example prompt", options=[x[0] for x in PROMPTS], key=3
|
| 96 |
)
|
| 97 |
|
| 98 |
-
with
|
| 99 |
output_tokens = st.number_input(
|
| 100 |
label="Output completion tokens",
|
| 101 |
min_value=0,
|
|
@@ -106,12 +106,16 @@ def expert_mode():
|
|
| 106 |
with st.container(border=True):
|
| 107 |
st.markdown("###### Configure the electricity mix of the data center")
|
| 108 |
|
| 109 |
-
location = st.selectbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
col4, col5, col6, col7 = st.columns(4)
|
| 112 |
|
| 113 |
-
|
| 114 |
-
electricity_mix = electricity_mixes.find_electricity_mix(country_code)
|
| 115 |
|
| 116 |
with col4:
|
| 117 |
em_gwp = st.number_input(
|
|
|
|
| 20 |
|
| 21 |
########## Model info ##########
|
| 22 |
|
| 23 |
+
provider_col, model_col = st.columns(2)
|
| 24 |
|
| 25 |
df = load_models(filter_main=True)
|
| 26 |
|
| 27 |
+
with provider_col:
|
| 28 |
provider_exp = st.selectbox(
|
| 29 |
label="Provider",
|
| 30 |
options=[x for x in df["provider_clean"].unique()],
|
|
|
|
| 32 |
key=1,
|
| 33 |
)
|
| 34 |
|
| 35 |
+
with model_col:
|
| 36 |
model_exp = st.selectbox(
|
| 37 |
label="Model",
|
| 38 |
options=[
|
|
|
|
| 72 |
|
| 73 |
########## Model parameters ##########
|
| 74 |
|
| 75 |
+
active_params_col, total_params_col = st.columns(2)
|
| 76 |
|
| 77 |
+
with active_params_col:
|
| 78 |
active_params = st.number_input(
|
| 79 |
"Active parameters (B)", 0, None, active_params
|
| 80 |
)
|
| 81 |
|
| 82 |
+
with total_params_col:
|
| 83 |
total_params = st.number_input(
|
| 84 |
"Total parameters (B)", 0, None, total_params
|
| 85 |
)
|
|
|
|
| 88 |
with st.container(border=True):
|
| 89 |
st.markdown("###### Configure the prompt")
|
| 90 |
|
| 91 |
+
provider_col, model_col = st.columns(2)
|
| 92 |
|
| 93 |
+
with provider_col:
|
| 94 |
output_tokens_exp = st.selectbox(
|
| 95 |
label="Example prompt", options=[x[0] for x in PROMPTS], key=3
|
| 96 |
)
|
| 97 |
|
| 98 |
+
with model_col:
|
| 99 |
output_tokens = st.number_input(
|
| 100 |
label="Output completion tokens",
|
| 101 |
min_value=0,
|
|
|
|
| 106 |
with st.container(border=True):
|
| 107 |
st.markdown("###### Configure the electricity mix of the data center")
|
| 108 |
|
| 109 |
+
location = st.selectbox(
|
| 110 |
+
label="Data center location",
|
| 111 |
+
options=[c[1] for c in COUNTRY_CODES],
|
| 112 |
+
format_func=format_country_name,
|
| 113 |
+
index=0
|
| 114 |
+
)
|
| 115 |
|
| 116 |
col4, col5, col6, col7 = st.columns(4)
|
| 117 |
|
| 118 |
+
electricity_mix = electricity_mixes.find_electricity_mix(location)
|
|
|
|
| 119 |
|
| 120 |
with col4:
|
| 121 |
em_gwp = st.number_input(
|