Sirorororo commited on
Commit
0c504eb
·
verified ·
1 Parent(s): 783894a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -162,13 +162,13 @@ async def extract_text(background_tasks: BackgroundTasks, file: UploadFile = Fil
162
  return {"error": str(e)}
163
 
164
  @app.post("/batch_extract_text")
165
- async def batch_extract_text(background_tasks: BackgroundTasks, files: List[UploadFile] = File(...)):
166
  """Extract text from multiple images with batching"""
167
  try:
168
  start_time = time.time()
169
 
170
  # Limit batch size for memory management
171
- max_batch_size = 7 # Adjust based on your GPU memory
172
 
173
  # if len(files) > 32:
174
  # return {"error": "A maximum of 20 images can be processed at a time."}
 
162
  return {"error": str(e)}
163
 
164
  @app.post("/batch_extract_text")
165
+ async def batch_extract_text(batch_size:int, background_tasks: BackgroundTasks, files: List[UploadFile] = File(...)):
166
  """Extract text from multiple images with batching"""
167
  try:
168
  start_time = time.time()
169
 
170
  # Limit batch size for memory management
171
+ max_batch_size = batch_size # Adjust based on your GPU memory
172
 
173
  # if len(files) > 32:
174
  # return {"error": "A maximum of 20 images can be processed at a time."}