michalisG commited on
Commit
3ce257f
1 Parent(s): 6bceac9

add deployed model

Browse files
Files changed (3) hide show
  1. .idea/workspace.xml +1 -0
  2. README.md +1 -0
  3. app.py +5 -1
.idea/workspace.xml CHANGED
@@ -6,6 +6,7 @@
6
  <component name="ChangeListManager">
7
  <list default="true" id="e2eb7b8e-f942-4b21-8057-83c784e0946e" name="Changes" comment="">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
 
9
  <change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
10
  </list>
11
  <option name="SHOW_DIALOG" value="false" />
 
6
  <component name="ChangeListManager">
7
  <list default="true" id="e2eb7b8e-f942-4b21-8057-83c784e0946e" name="Changes" comment="">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
10
  <change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
11
  </list>
12
  <option name="SHOW_DIALOG" value="false" />
README.md CHANGED
@@ -8,6 +8,7 @@ sdk_version: 4.23.0
8
  app_file: app.py
9
  pinned: false
10
  python_version: 3.9
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  app_file: app.py
9
  pinned: false
10
  python_version: 3.9
11
+ model: [Proddis/pbc_complication_model]
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -8,10 +8,14 @@ from matplotlib import pyplot as plt
8
  from utils.data_processor import DataProcessor
9
  from utils.model_predictor import ModelPredictor
10
  from utils.data import patients_data, key_to_display_name_and_value_conversion
 
 
11
 
 
 
 
12
 
13
 
14
- model = gr.load("models/Proddis/pbc_complication_model").launch()
15
  categorical_names = joblib.load('resources/categorical_names.pkl')
16
  target_labels = joblib.load('resources/target_labels.pkl')
17
  selected_features = []
 
8
  from utils.data_processor import DataProcessor
9
  from utils.model_predictor import ModelPredictor
10
  from utils.data import patients_data, key_to_display_name_and_value_conversion
11
+ from huggingface_hub import hf_hub_download
12
+ import joblib
13
 
14
+ model = joblib.load(
15
+ hf_hub_download("Proddis/pbc_complication_model", "RandomForestClassifier_trained_pipeline.joblib")
16
+ )
17
 
18
 
 
19
  categorical_names = joblib.load('resources/categorical_names.pkl')
20
  target_labels = joblib.load('resources/target_labels.pkl')
21
  selected_features = []