arifulamin commited on
Commit
ef1cb70
ยท
verified ยท
1 Parent(s): c91bb99

Sync App files

Browse files
Files changed (2) hide show
  1. README.md +0 -8
  2. app.py +4 -7
README.md CHANGED
@@ -1,11 +1,3 @@
1
- ---
2
- license: apache-2.0
3
- title: drug-discovery
4
- sdk: gradio
5
- emoji: ๐Ÿ“Š
6
- colorFrom: green
7
- colorTo: blue
8
- ---
9
  title: Drug Classification
10
  emoji: ๐Ÿ“‰
11
  colorFrom: purple
 
 
 
 
 
 
 
 
 
1
  title: Drug Classification
2
  emoji: ๐Ÿ“‰
3
  colorFrom: purple
app.py CHANGED
@@ -1,8 +1,5 @@
1
  import gradio as gr
2
- import joblib
3
-
4
-
5
-
6
 
7
  # Explicitly specify trusted types
8
  trusted_types = [
@@ -14,11 +11,11 @@ trusted_types = [
14
  "sklearn.impute.SimpleImputer",
15
  "sklearn.tree.DecisionTreeClassifier",
16
  "sklearn.ensemble.RandomForestClassifier",
17
- "numpy.dtype",
18
  ]
19
 
20
- pipe = joblib.load("../Model/model.pkl")
21
-
22
 
23
  def predict_drug(age, sex, blood_pressure, cholesterol, na_to_k_ratio):
24
  """Predict drugs based on patient features.
 
1
  import gradio as gr
2
+ import skops.io as sio
 
 
 
3
 
4
  # Explicitly specify trusted types
5
  trusted_types = [
 
11
  "sklearn.impute.SimpleImputer",
12
  "sklearn.tree.DecisionTreeClassifier",
13
  "sklearn.ensemble.RandomForestClassifier",
14
+ "numpy.dtype", # Add this line to trust numpy.dtype
15
  ]
16
 
17
+ # Load the model using skops (adjust path to your .skops file)
18
+ pipe = sio.load("../Model/drug_pipeline.skops", trusted=trusted_types) # Use .skops file instead of .pkl
19
 
20
  def predict_drug(age, sex, blood_pressure, cholesterol, na_to_k_ratio):
21
  """Predict drugs based on patient features.