rockerritesh commited on
Commit
bb18f6f
·
verified ·
1 Parent(s): 6e3dbc0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -145,7 +145,7 @@ def predict(image):
145
  # Clean up intermediates
146
  del model_inputs, generation
147
  clean_memory()
148
- del model,processor
149
  return decoded
150
 
151
  @app.post("/extract_text")
@@ -172,7 +172,7 @@ async def batch_extract_text(batch_size:int, background_tasks: BackgroundTasks,
172
  start_time = time.time()
173
 
174
  # Limit batch size for memory management
175
- max_batch_size = batch_size # Adjust based on your GPU memory
176
 
177
  # if len(files) > 32:
178
  # return {"error": "A maximum of 20 images can be processed at a time."}
 
145
  # Clean up intermediates
146
  del model_inputs, generation
147
  clean_memory()
148
+ # del model,processor
149
  return decoded
150
 
151
  @app.post("/extract_text")
 
172
  start_time = time.time()
173
 
174
  # Limit batch size for memory management
175
+ max_batch_size = 32 # Adjust based on your GPU memory
176
 
177
  # if len(files) > 32:
178
  # return {"error": "A maximum of 20 images can be processed at a time."}