Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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 =
|
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."}
|