poudel commited on
Commit
6b68bac
1 Parent(s): 020dba7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -4,11 +4,12 @@ import joblib
4
  import numpy as np
5
  from models.neural_network.inference import load_model_and_preprocessor
6
 
7
- # Load the pre-trained model
8
- nn_model, nn_preprocessor = load_model_and_preprocessor('/Users/ashishpoudel/Downloads/AircraftFuelPrediction-main/saved_models/nn_model.keras',
9
- '/Users/ashishpoudel/Downloads/AircraftFuelPrediction-main/saved_models/nn_preprocessor.pkl')
 
 
10
 
11
- xgboost_model = joblib.load('/Users/ashishpoudel/Downloads/AircraftFuelPrediction-main/saved_models/xgboost_model.joblib')
12
 
13
  # Load the unique aircraft data
14
  aircraft_data = pd.read_csv('/Users/ashishpoudel/Downloads/AircraftFuelPrediction-main/datasets/aircraft_data.csv').drop_duplicates(subset='model')
 
4
  import numpy as np
5
  from models.neural_network.inference import load_model_and_preprocessor
6
 
7
+ from huggingface_hub import hf_hub_download
8
+
9
+ # Download the model from Hugging Face hub
10
+ model_filename = hf_hub_download(repo_id="poudel/AircraftFuelPrediction", filename='nn_model.keras','nn_preprocessor.pkl
11
+ ')
12
 
 
13
 
14
  # Load the unique aircraft data
15
  aircraft_data = pd.read_csv('/Users/ashishpoudel/Downloads/AircraftFuelPrediction-main/datasets/aircraft_data.csv').drop_duplicates(subset='model')