randomshit11 commited on
Commit
16ab4c8
·
1 Parent(s): 6be23c8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -14,13 +14,13 @@ app.add_middleware(
14
 
15
  # Define a route for the prediction using FastAPI
16
  @app.post("/predict")
17
- async def predict(text: str , min_length: int , max_length: int ):
18
- client = Client("https://randomshit11-randomshit11-fin-bert-1st-shit.hf.space/--replicas/7cc9645sr2l/")
19
  result = client.predict(
20
  "shorten", # str in 'Mode' Radio component
21
  text, # str in 'text' Textbox component
22
- min_length, # int | float (numeric value between 5 and 200) in 'Min length' Slider component
23
- max_length, # int | float (numeric value between 5 and 500) in 'Max length' Slider component
24
  api_name="/predict"
25
  )
26
  print(result)
 
14
 
15
  # Define a route for the prediction using FastAPI
16
  @app.post("/predict")
17
+ async def predict(text: str):
18
+ client = Client("https://randomshit11-randomshit11-fin-bert-1st-shit.hf.space/--replicas/lh5fx/")
19
  result = client.predict(
20
  "shorten", # str in 'Mode' Radio component
21
  text, # str in 'text' Textbox component
22
+ 5, # int | float (numeric value between 5 and 200) in 'Min length' Slider component
23
+ 128, # int | float (numeric value between 5 and 500) in 'Max length' Slider component
24
  api_name="/predict"
25
  )
26
  print(result)