Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from huggingface_hub import hf_hub_download
|
2 |
-
import
|
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 |
-
|
|
|
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):
|