DontPlanToEnd commited on
Commit
8ec1151
β€’
1 Parent(s): 42bdf56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -6,6 +6,7 @@ import numpy as np
6
  from functools import partial
7
  from gradio_rangeslider import RangeSlider
8
  from datetime import datetime, timedelta
 
9
 
10
  # Encode kofi_button.png
11
  current_dir = os.path.dirname(os.path.realpath(__file__))
@@ -141,7 +142,8 @@ def update_table(df: pd.DataFrame, query: str, param_ranges: list, is_foundation
141
  filtered_df = filtered_df[filtered_df['Foundation'] == 1]
142
 
143
  if query:
144
- filtered_df = filtered_df[filtered_df['Model'].str.contains(query, case=False, na=False)]
 
145
 
146
  # Apply W/10 filtering
147
  if 'W/10 πŸ‘' in filtered_df.columns:
@@ -393,4 +395,4 @@ with GraInter:
393
  )
394
 
395
  # Launch the Gradio app
396
- GraInter.launch()
 
6
  from functools import partial
7
  from gradio_rangeslider import RangeSlider
8
  from datetime import datetime, timedelta
9
+ import re
10
 
11
  # Encode kofi_button.png
12
  current_dir = os.path.dirname(os.path.realpath(__file__))
 
142
  filtered_df = filtered_df[filtered_df['Foundation'] == 1]
143
 
144
  if query:
145
+ escaped_query = re.escape(query)
146
+ filtered_df = filtered_df[filtered_df['Model'].str.contains(escaped_query, case=False, na=False, regex=True)]
147
 
148
  # Apply W/10 filtering
149
  if 'W/10 πŸ‘' in filtered_df.columns:
 
395
  )
396
 
397
  # Launch the Gradio app
398
+ GraInter.launch()