suryadev1 commited on
Commit
5e01faf
·
verified ·
1 Parent(s): 11d3e0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from huggingface_hub import hf_hub_download
2
- import joblib
3
  import gradio as gr
4
  import numpy as np
5
 
@@ -7,7 +7,8 @@ import numpy as np
7
  model_path = hf_hub_download(repo_id="suryadev1/knn", filename="knn_model.pkl")
8
 
9
  # Load the model
10
- knn = joblib.load(model_path)
 
11
 
12
  # Define the prediction function
13
  def predict(input_data):
 
1
  from huggingface_hub import hf_hub_download
2
+ import pickle
3
  import gradio as gr
4
  import numpy as np
5
 
 
7
  model_path = hf_hub_download(repo_id="suryadev1/knn", filename="knn_model.pkl")
8
 
9
  # Load the model
10
+ with open(model_path, 'rb') as f:
11
+ knn = pickle.load(f)
12
 
13
  # Define the prediction function
14
  def predict(input_data):