A-Celsius commited on
Commit
1aab852
·
1 Parent(s): 44b6088

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ model = joblib.load('model.pkl')
7
  def preprocess_city(selected_city):
8
  # Map the selected city to its one-hot encoded representation
9
  city_mapping = {
 
10
  'Indore': [1, 0, 0, 0, 0, 0, 0],
11
  'Jaipur': [0, 1, 0, 0, 0, 0, 0],
12
  'Mahabaleshwar': [0, 0, 1, 0, 0, 0, 0],
@@ -84,7 +85,7 @@ def predict(selected_city, checkin_date, star_rating, text_rating, season, addit
84
  return "{:.2f}".format(prediction[0])
85
 
86
  # Define input components
87
- city_dropdown = gr.components.Dropdown(choices=['Indore', 'Jaipur', 'Mahabaleshwar', 'Mussoorie', 'Raipur', 'Udaipur', 'Varanasi'], label='Select a City')
88
  date_input = gr.components.Textbox(label='Check-in Date (YYYY-MM-DD)')
89
  star_rating_dropdown = gr.components.Dropdown(choices=[1, 2, 3, 4, 5], label='Select Star Rating')
90
  text_rating_input = gr.components.Number(label='Enter Numeric Rating (1-5)')
 
7
  def preprocess_city(selected_city):
8
  # Map the selected city to its one-hot encoded representation
9
  city_mapping = {
10
+ 'Hyderabad' : : [1, 0, 0, 0, 0, 0, 0],
11
  'Indore': [1, 0, 0, 0, 0, 0, 0],
12
  'Jaipur': [0, 1, 0, 0, 0, 0, 0],
13
  'Mahabaleshwar': [0, 0, 1, 0, 0, 0, 0],
 
85
  return "{:.2f}".format(prediction[0])
86
 
87
  # Define input components
88
+ city_dropdown = gr.components.Dropdown(choices=['Hyderabad', 'Indore', 'Jaipur', 'Mahabaleshwar', 'Mussoorie', 'Raipur', 'Udaipur', 'Varanasi'], label='Select a City')
89
  date_input = gr.components.Textbox(label='Check-in Date (YYYY-MM-DD)')
90
  star_rating_dropdown = gr.components.Dropdown(choices=[1, 2, 3, 4, 5], label='Select Star Rating')
91
  text_rating_input = gr.components.Number(label='Enter Numeric Rating (1-5)')