Spaces:
Build error
Build error
Commit
·
16ab4c8
1
Parent(s):
6be23c8
Update main.py
Browse files
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
|
18 |
-
client = Client("https://randomshit11-randomshit11-fin-bert-1st-shit.hf.space/--replicas/
|
19 |
result = client.predict(
|
20 |
"shorten", # str in 'Mode' Radio component
|
21 |
text, # str in 'text' Textbox component
|
22 |
-
|
23 |
-
|
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)
|