Update app.py
Browse files
app.py
CHANGED
@@ -148,14 +148,14 @@ def search_hotel(place=None):
|
|
148 |
if df_found is None:
|
149 |
return pd.DataFrame()
|
150 |
|
151 |
-
df_found = df_found.head(
|
152 |
hotel_ids = df_found["hotel_id"].values.tolist()
|
153 |
filtered_df = df_hotels[df_hotels['hotel_id'].isin(hotel_ids)]
|
154 |
|
155 |
# Use .loc[] to avoid SettingWithCopyWarning
|
156 |
filtered_df.loc[:, 'hotel_id'] = pd.Categorical(filtered_df['hotel_id'], categories=hotel_ids, ordered=True)
|
157 |
filtered_df = filtered_df.sort_values('hotel_id').reset_index(drop=True)
|
158 |
-
grouped_df = filtered_df.groupby('hotel_id', observed=True).head(
|
159 |
description_data = []
|
160 |
|
161 |
for index, row in grouped_df.iterrows():
|
|
|
148 |
if df_found is None:
|
149 |
return pd.DataFrame()
|
150 |
|
151 |
+
df_found = df_found.head(1) # Only last 1 hotels, to save runtime of Hugging Face ZERO GPU
|
152 |
hotel_ids = df_found["hotel_id"].values.tolist()
|
153 |
filtered_df = df_hotels[df_hotels['hotel_id'].isin(hotel_ids)]
|
154 |
|
155 |
# Use .loc[] to avoid SettingWithCopyWarning
|
156 |
filtered_df.loc[:, 'hotel_id'] = pd.Categorical(filtered_df['hotel_id'], categories=hotel_ids, ordered=True)
|
157 |
filtered_df = filtered_df.sort_values('hotel_id').reset_index(drop=True)
|
158 |
+
grouped_df = filtered_df.groupby('hotel_id', observed=True).head(1)
|
159 |
description_data = []
|
160 |
|
161 |
for index, row in grouped_df.iterrows():
|