Vokturz commited on
Commit
161a324
1 Parent(s): 79399de

improve how gpu are displayed

Browse files
Files changed (1) hide show
  1. src/app.py +4 -5
src/app.py CHANGED
@@ -52,16 +52,15 @@ if model_name not in st.session_state:
52
 
53
  gpu_vendor = st.sidebar.selectbox("GPU Vendor", ["NVIDIA", "AMD", "Intel"])
54
  # year = st.sidebar.selectbox("Filter by Release Year", list(range(2014, 2024))[::-1], index=None)
55
- gpu_info = gpu_specs[gpu_specs['Vendor'] == gpu_vendor].sort_values('RAM (GB)', ascending=False)
56
  # if year:
57
  # gpu_info = gpu_info[gpu_info['Year'] == year]
58
 
59
  min_ram = gpu_info['RAM (GB)'].min()
60
  max_ram = gpu_info['RAM (GB)'].max()
61
- ram = st.sidebar.slider("Filter by RAM (GB)", min_ram, max_ram, (min_ram, max_ram), step=0.5)
62
- gpu_info = gpu_info[gpu_info["RAM (GB)"].between(*ram)]
63
- gpu = st.sidebar.selectbox("GPU", gpu_info['Product Name'].index.tolist(), index=21, format_func=lambda x : gpu_specs.iloc[x]['Product Name'])
64
-
65
  gpu_spec = gpu_specs.iloc[gpu]
66
  gpu_spec.name = 'INFO'
67
 
 
52
 
53
  gpu_vendor = st.sidebar.selectbox("GPU Vendor", ["NVIDIA", "AMD", "Intel"])
54
  # year = st.sidebar.selectbox("Filter by Release Year", list(range(2014, 2024))[::-1], index=None)
55
+ gpu_info = gpu_specs[gpu_specs['Vendor'] == gpu_vendor].sort_values('Product Name')
56
  # if year:
57
  # gpu_info = gpu_info[gpu_info['Year'] == year]
58
 
59
  min_ram = gpu_info['RAM (GB)'].min()
60
  max_ram = gpu_info['RAM (GB)'].max()
61
+ ram = st.sidebar.slider("Filter by RAM (GB)", min_ram, max_ram, (10.0, 40.0), step=0.5)
62
+ gpu_info = gpu_info[gpu_info["RAM (GB)"].between(ram[0], ram[1])]
63
+ gpu = st.sidebar.selectbox("GPU", gpu_info['Product Name'].index.tolist(), format_func=lambda x : gpu_specs.iloc[x]['Product Name'])
 
64
  gpu_spec = gpu_specs.iloc[gpu]
65
  gpu_spec.name = 'INFO'
66