jonathanjordan21 commited on
Commit
5670d88
·
verified ·
1 Parent(s): 5449850

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -593,16 +593,22 @@ def build_outputs(results, descriptions, result_details, plate_number):
593
 
594
  app = FastAPI()
595
 
 
 
 
 
 
 
596
  @app.post("/pred")
597
- async def greet_json(
598
- message : str,
599
- threshold : float = 0.0005,
600
- tarif_pkb : float = 0.015,
601
- tarif_bbnkb : float = 0.1,
602
- ):
603
  global codes_emb
604
  global undetected
605
-
 
 
 
 
 
606
  undetected_code = undetected[:3]
607
 
608
  # tarif_pkb = 1.5/100
 
593
 
594
  app = FastAPI()
595
 
596
+ class InputData(BaseModel):
597
+ message: str
598
+ threshold: float = 0.0005
599
+ tarif_pkb: float = 0.015
600
+ tarif_bbnkb: float = 0.1
601
+
602
  @app.post("/pred")
603
+ async def greet_json(body: InputData):
 
 
 
 
 
604
  global codes_emb
605
  global undetected
606
+
607
+ message = body.message
608
+ threshold = body.threshold
609
+ tarif_pkb = body.tarif_pkb
610
+ tarif_bbnkb = body.tarif_bbnkb
611
+
612
  undetected_code = undetected[:3]
613
 
614
  # tarif_pkb = 1.5/100