backend-junPreP Update(Update whitelist model), front-urlpredictor.jsx UI Update
This commit is contained in:
@@ -2,7 +2,6 @@ from fastapi import FastAPI
|
||||
from pydantic import BaseModel
|
||||
from app.model_load import use_model # predictor.py에서 함수 import
|
||||
from app.exe import predict_url_maliciousness
|
||||
from app.utils import convert_numpy_to_python_types
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
app = FastAPI()
|
||||
@@ -28,13 +27,15 @@ def root():
|
||||
def predict(request: UrlRequest):
|
||||
url = request.url
|
||||
|
||||
result_model1 = convert_numpy_to_python_types(use_model(url))
|
||||
result_model2 = convert_numpy_to_python_types(predict_url_maliciousness(url))
|
||||
|
||||
response_data = {
|
||||
"url": url,
|
||||
"model1": result_model1,
|
||||
"model2": result_model2
|
||||
}
|
||||
|
||||
return convert_numpy_to_python_types(response_data)
|
||||
result_model1 = use_model(url)
|
||||
result_model2 = predict_url_maliciousness(url)
|
||||
# print("model1 : ")
|
||||
# print(result_model1.values())
|
||||
# print("model2 : ")
|
||||
# print(result_model2.values())
|
||||
|
||||
return {
|
||||
"url" : url,
|
||||
"model1": result_model1,
|
||||
"model2": result_model2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user