Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
|
|
3 |
def calculate_cost(num_pairs, gpu_type):
|
4 |
if gpu_type == "Nvidia A100":
|
5 |
daily_rate = 28
|
@@ -10,45 +11,54 @@ def calculate_cost(num_pairs, gpu_type):
|
|
10 |
else: # AWS p4d.24xlarge
|
11 |
daily_rate = 786.48
|
12 |
time_per_pair = 0.25 # assuming it's four times as fast due to 8 GPUs
|
|
|
13 |
total_time_minutes = num_pairs * time_per_pair
|
14 |
total_time_hours = total_time_minutes / 60
|
15 |
hourly_rate = daily_rate / 24
|
16 |
total_cost = total_time_hours * hourly_rate
|
17 |
-
|
18 |
return total_cost
|
19 |
-
def main():
|
20 |
-
st.title("GPU Cost Calculator")
|
21 |
-
# Input for number of pairs
|
22 |
-
num_pairs = st.number_input("Enter the number of pairs to process:", min_value=1, value=5)
|
23 |
-
# Select GPU type
|
24 |
-
gpu_type = st.selectbox(
|
25 |
-
"Select GPU type:",
|
26 |
-
("Nvidia A100", "H100 80GB PCIe", "AWS p4d.24xlarge (8x A100)")
|
27 |
-
)
|
28 |
-
# Calculate button
|
29 |
-
if st.button("Calculate Cost"):
|
30 |
-
cost = calculate_cost(num_pairs, gpu_type)
|
31 |
-
st.write(f"Estimated cost for processing {num_pairs} pairs on {gpu_type}: ${cost:.4f}")
|
32 |
-
# Display GPU information
|
33 |
-
st.subheader("GPU Information")
|
34 |
-
gpu_data = {
|
35 |
-
"Provider": ["H100 80GB PCIe", "AWS (p4d.24xlarge)", "GPU Mart"],
|
36 |
-
"GPU": ["Nvidia H100", "Nvidia A100 (8 GPUs)", "Nvidia A100"],
|
37 |
-
"vCPUs": [16, 96, "Dual 18-Core E5-2697v4"],
|
38 |
-
"RAM": ["125 GB", "1152 GiB", "256 GB"],
|
39 |
-
"GPU Memory": ["80 GB", "320 GB (8 x 40 GB)", "40 GB HBM2e"],
|
40 |
-
"Instance Storage": ["Network Storage: 10Pb+", "8 x 1000 GB NVMe SSD", "240 GB SSD + 2TB NVMe + 8TB SATA"],
|
41 |
-
"Network Bandwidth": ["Not Specified", "400 Gbps", "100Mbps - 1Gbps"],
|
42 |
-
"On-Demand Price/hr": ["$3.29", "$32.77", "N/A"],
|
43 |
-
"Daily Price": ["$78.96", "$786.48", "$28.00"],
|
44 |
-
"Monthly Price": ["$2,368.80", "$23,594.40", "$799.00"],
|
45 |
-
"1-Year Reserved (Hourly)": ["N/A", "$19.22", "N/A"],
|
46 |
-
"3-Year Reserved (Hourly)": ["N/A", "$11.57", "N/A"]
|
47 |
-
}
|
48 |
-
|
49 |
-
df = pd.DataFrame(gpu_data)
|
50 |
-
st.table(df)
|
51 |
-
if name == "app":
|
52 |
-
main()
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
+
|
4 |
def calculate_cost(num_pairs, gpu_type):
|
5 |
if gpu_type == "Nvidia A100":
|
6 |
daily_rate = 28
|
|
|
11 |
else: # AWS p4d.24xlarge
|
12 |
daily_rate = 786.48
|
13 |
time_per_pair = 0.25 # assuming it's four times as fast due to 8 GPUs
|
14 |
+
|
15 |
total_time_minutes = num_pairs * time_per_pair
|
16 |
total_time_hours = total_time_minutes / 60
|
17 |
hourly_rate = daily_rate / 24
|
18 |
total_cost = total_time_hours * hourly_rate
|
19 |
+
|
20 |
return total_cost
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
st.set_page_config(page_title="GPU Cost Calculator", page_icon="🧮", layout="wide")
|
23 |
+
|
24 |
+
st.title("GPU Cost Calculator")
|
25 |
+
|
26 |
+
# Input for number of pairs
|
27 |
+
num_pairs = st.number_input("Enter the number of pairs to process:", min_value=1, value=5)
|
28 |
+
|
29 |
+
# Input for shirt size
|
30 |
+
shirt_size = st.text_input("Enter shirt size (e.g., S, M, L, XL):")
|
31 |
+
|
32 |
+
# Input for bottom wear size
|
33 |
+
bottom_wear_size = st.text_input("Enter bottom wear size (e.g., S, M, L, XL):")
|
34 |
+
|
35 |
+
# Select GPU type
|
36 |
+
gpu_type = st.selectbox(
|
37 |
+
"Select GPU type:",
|
38 |
+
("Nvidia A100", "H100 80GB PCIe", "AWS p4d.24xlarge (8x A100)")
|
39 |
+
)
|
40 |
+
|
41 |
+
# Calculate button
|
42 |
+
if st.button("Calculate Cost"):
|
43 |
+
cost = calculate_cost(num_pairs, gpu_type)
|
44 |
+
st.write(f"Estimated cost for processing {num_pairs} pairs on {gpu_type}: ${cost:.4f}")
|
45 |
+
|
46 |
+
# Display GPU information
|
47 |
+
st.subheader("GPU Information")
|
48 |
+
gpu_data = {
|
49 |
+
"Provider": ["H100 80GB PCIe", "AWS (p4d.24xlarge)", "GPU Mart"],
|
50 |
+
"GPU": ["Nvidia H100", "Nvidia A100 (8 GPUs)", "Nvidia A100"],
|
51 |
+
"vCPUs": [16, 96, "Dual 18-Core E5-2697v4"],
|
52 |
+
"RAM": ["125 GB", "1152 GiB", "256 GB"],
|
53 |
+
"GPU Memory": ["80 GB", "320 GB (8 x 40 GB)", "40 GB HBM2e"],
|
54 |
+
"Instance Storage": ["Network Storage: 10Pb+", "8 x 1000 GB NVMe SSD", "240 GB SSD + 2TB NVMe + 8TB SATA"],
|
55 |
+
"Network Bandwidth": ["Not Specified", "400 Gbps", "100Mbps - 1Gbps"],
|
56 |
+
"On-Demand Price/hr": ["$3.29", "$32.77", "N/A"],
|
57 |
+
"Daily Price": ["$78.96", "$786.48", "$28.00"],
|
58 |
+
"Monthly Price": ["$2,368.80", "$23,594.40", "$799.00"],
|
59 |
+
"1-Year Reserved (Hourly)": ["N/A", "$19.22", "N/A"],
|
60 |
+
"3-Year Reserved (Hourly)": ["N/A", "$11.57", "N/A"]
|
61 |
+
}
|
62 |
|
63 |
+
df = pd.DataFrame(gpu_data)
|
64 |
+
st.table(df)
|