Skip to content

Commit 7e7a10e

Browse files
committed
test
1 parent 1bbc490 commit 7e7a10e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
167 Bytes
Binary file not shown.

Backend/test_sum.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import asyncio
77

8-
progress = "NULL" # just for tracking progress
8+
progress = None # just for tracking progress
99

1010
def summary(text):
1111
# Load the summarization pipeline
@@ -72,7 +72,14 @@ async def get_summary(file: UploadFile = File(...)):
7272
data = await gen_summary(file)
7373
return data
7474

75-
@router_summariser.get("/summary-gen-progress")
75+
@router_summariser.get("/summary-gen-progress") # route to track progress of summarization
7676
def get_summary_progress():
7777
global progress
78-
return {"status" : progress }
78+
if progress is None :
79+
return {"status" : "No summarisation process in progress" }
80+
elif progress == 100 :
81+
return {"status" : "Completed" , "value" : progress}
82+
elif progress in range(0,101) :
83+
return {"status" : progress}
84+
else :
85+
return {"invalid data detected"}

0 commit comments

Comments
 (0)