-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (20 loc) · 543 Bytes
/
main.py
File metadata and controls
24 lines (20 loc) · 543 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import uvicorn
from fastapi import FastAPI
import joblib,os
app = FastAPI()
#pkl
phish_model = open('phishing.pkl','rb')
phish_model_ls = joblib.load(phish_model)
# ML Aspect
@app.get('/predict/{feature}')
async def predict(features):
X_predict = []
X_predict.append(str(features))
y_Predict = phish_model_ls.predict(X_predict)
if y_Predict == 'good':
result = "This is a Phishing Site"
else:
result = "This is not a Phishing Site"
return (features, result)
if __name__ == '__main__':
uvicorn.run(app,host="127.0.0.1",port=8000)