fmegahed commited on
Commit
21106dc
·
1 Parent(s): e732af4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -10,6 +10,10 @@ import sklearn
10
  import gradio as gr
11
  import numpy as np
12
 
 
 
 
 
13
  ex_data = pd.read_csv('https://raw.githubusercontent.com/fmegahed/tavr_paper/main/data/example_data2.csv')
14
  ex_data = ex_data.to_numpy()
15
  ex_data = ex_data.tolist()
@@ -26,7 +30,9 @@ def predict(age, female, race, elective, aweekend, zipinc_qrtl, hosp_region, hos
26
  pulmonary_circulation_disorder, smoker, valvular_disease, weight_loss,
27
  endovascular_tavr, transapical_tavr):
28
 
29
- model = load_model('https://github.com/fmegahed/tavr_paper/blob/main/data/final_model.pkl?raw=true')
 
 
30
 
31
  df = pd.DataFrame.from_dict({
32
  'age': [age], 'female': [female], 'race': [race], 'elective': elective,
 
10
  import gradio as gr
11
  import numpy as np
12
 
13
+ from io import BytesIO
14
+ import pickle
15
+ import requests
16
+
17
  ex_data = pd.read_csv('https://raw.githubusercontent.com/fmegahed/tavr_paper/main/data/example_data2.csv')
18
  ex_data = ex_data.to_numpy()
19
  ex_data = ex_data.tolist()
 
30
  pulmonary_circulation_disorder, smoker, valvular_disease, weight_loss,
31
  endovascular_tavr, transapical_tavr):
32
 
33
+ mLink = 'https://github.com/fmegahed/tavr_paper/blob/main/data/final_model.pkl?raw=true'
34
+ mfile = BytesIO(requests.get(mLink).content)
35
+ model = load_model(mfile)
36
 
37
  df = pd.DataFrame.from_dict({
38
  'age': [age], 'female': [female], 'race': [race], 'elective': elective,