Spaces:
Sleeping
Sleeping
judebebo32
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,15 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import pickle
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
import
|
|
|
|
|
|
|
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:
|