Mekam commited on
Commit
694d1b8
·
1 Parent(s): 407361d

feat(predict): added road for prediction ajd load models

Browse files
README.md DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- title: NetSentinel
3
- emoji: 📊
4
- colorFrom: pink
5
- colorTo: pink
6
- sdk: docker
7
- pinned: false
8
- short_description: detecting and fine-tuning models against IoT network attacks
9
- ---
10
-
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -1,11 +1,14 @@
1
  from fastapi import FastAPI
2
- from src.routes import user_routes, organisation_routes
 
3
 
4
  app = FastAPI(title="NetSentinel Backend")
5
 
6
  # Register routers
7
  app.include_router(user_routes.router)
8
- app.include_router(organisation_routes.router)
 
 
9
 
10
  @app.get("/")
11
  def root():
 
1
  from fastapi import FastAPI
2
+ from routes import organization_routes, prediction_routes
3
+ from src.routes import user_routes
4
 
5
  app = FastAPI(title="NetSentinel Backend")
6
 
7
  # Register routers
8
  app.include_router(user_routes.router)
9
+ app.include_router(organization_routes.router)
10
+ app.include_router(prediction_routes.router)
11
+
12
 
13
  @app.get("/")
14
  def root():
src/controllers/{organisation_controller.py → organization_controller.py} RENAMED
@@ -1,3 +1,3 @@
1
- def get_organisations():
2
- print("Fetching organisations...")
3
  return {"message": "List of organisations"}
 
1
+ def get_organizations():
2
+ print("Fetching organization...")
3
  return {"message": "List of organisations"}
src/controllers/prediction_controller.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ def global_prediction_on_csv():
2
+ # log dans la console
3
+ print("predicting...")
4
+ return {"message": "List of predictions"}
src/models/L1_Logistic_v0.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79d5f16e998f61fdf1faff94e137865437cf932fc6a1fa5c6b01fa3cf4302c47
3
+ size 2617
src/models/l2_XGBOOST_Supervisor_V0.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c27fc4fcfb190b6c580bfbcecfd9caebacdaa1036bc9b53671784dfaff12ee97
3
+ size 5418
src/routes/organisation_routes.py DELETED
@@ -1,8 +0,0 @@
1
- from fastapi import APIRouter
2
- from src.controllers import organisation_controller
3
-
4
- router = APIRouter(prefix="/organisations", tags=["Organisations"])
5
-
6
- @router.get("/")
7
- def list_organisations():
8
- return organisation_controller.get_organisations()
 
 
 
 
 
 
 
 
 
src/routes/organization_routes.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from fastapi import APIRouter
2
+ from src.controllers import organization_controller
3
+
4
+ router = APIRouter(prefix="/organizations", tags=["organizations"])
5
+
6
+ @router.get("/")
7
+ def list_organizations():
8
+ return organization_controller.get_organizations()
src/routes/prediction_routes.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from fastapi import APIRouter
2
+ from src.controllers import prediction_controller
3
+
4
+ router = APIRouter(prefix="/predict", tags=["predict"])
5
+
6
+ @router.get("/")
7
+ def list_users():
8
+ return prediction_controller.global_prediction_on_csv()