Spaces:
Runtime error
Runtime error
Sync App files
Browse files
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
|
| 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 |
-
|
| 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.
|