arifulamin commited on
Commit
b5b49f8
·
verified ·
1 Parent(s): c7c9dd5

Sync App files

Browse files
Files changed (3) hide show
  1. README.md +0 -4
  2. app.py +6 -10
  3. requirements.txt +1 -2
README.md CHANGED
@@ -1,7 +1,3 @@
1
- ---
2
- license: mit
3
- sdk: gradio
4
- ---
5
  title: Drug Classification
6
  emoji: 📉
7
  colorFrom: purple
 
 
 
 
 
1
  title: Drug Classification
2
  emoji: 📉
3
  colorFrom: purple
app.py CHANGED
@@ -1,17 +1,12 @@
1
-
2
  import gradio as gr
3
- import skops.io as sio
4
  import warnings
5
  from sklearn.exceptions import InconsistentVersionWarning
6
 
7
- import subprocess
8
- import sys
9
 
10
- try:
11
- import skops.io as sio
12
- except ModuleNotFoundError:
13
- subprocess.check_call([sys.executable, "-m", "pip", "install", "skops"])
14
- import skops.io as sio # Retry import after installation
15
 
16
  # Suppress the version warnings
17
  warnings.filterwarnings("ignore", category=InconsistentVersionWarning)
@@ -28,7 +23,8 @@ trusted_types = [
28
  "sklearn.ensemble.RandomForestClassifier",
29
  "numpy.dtype",
30
  ]
31
- pipe = sio.load("./Model/drug_pipeline.skops", trusted=trusted_types)
 
32
 
33
 
34
  def predict_drug(age, sex, blood_pressure, cholesterol, na_to_k_ratio):
 
 
1
  import gradio as gr
 
2
  import warnings
3
  from sklearn.exceptions import InconsistentVersionWarning
4
 
 
 
5
 
6
+ import joblib
7
+
8
+
9
+
 
10
 
11
  # Suppress the version warnings
12
  warnings.filterwarnings("ignore", category=InconsistentVersionWarning)
 
23
  "sklearn.ensemble.RandomForestClassifier",
24
  "numpy.dtype",
25
  ]
26
+
27
+ pipe = joblib.load("model.pkl", trusted=trusted_types)
28
 
29
 
30
  def predict_drug(age, sex, blood_pressure, cholesterol, na_to_k_ratio):
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
- --upgrade pip
2
  scikit-learn
3
- skops
4
  gradio
 
1
+ joblib
2
  scikit-learn
 
3
  gradio