judebebo32 commited on
Commit
5bb554a
·
verified ·
1 Parent(s): 6d63187

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -1,10 +1,15 @@
 
 
1
  import gradio as gr
2
  import pandas as pd
3
  import pickle
4
- import pandas as pd
5
- import numpy as np
6
- import math
7
- import pickle
 
 
 
8
 
9
  # Load the pre-trained model
10
  with open('best_model.pkl', 'rb') as model_file:
 
1
+ import subprocess
2
+ import sys
3
  import gradio as gr
4
  import pandas as pd
5
  import pickle
6
+
7
+ # Check if scikit-learn is installed, and if not, install it
8
+ try:
9
+ import sklearn
10
+ except ModuleNotFoundError:
11
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "scikit-learn"])
12
+ import sklearn
13
 
14
  # Load the pre-trained model
15
  with open('best_model.pkl', 'rb') as model_file: