document_redaction / entrypoint_router.py
seanpedrickcase's picture
Corrected references to max_queue_size and max_file_size
2bb3ff5
raw
history blame
957 Bytes
import os
import subprocess
if __name__ == "__main__":
run_direct_mode = os.getenv("RUN_DIRECT_MODE", "0")
if run_direct_mode == "1":
# Lambda execution or CLI invocation (Direct Mode)
from lambda_entrypoint import lambda_handler
# Simulate the Lambda event and context for local testing
event = os.getenv("LAMBDA_TEST_EVENT", '{}')
context = None # Add mock context if needed
response = lambda_handler(eval(event), context)
print(response)
else:
# Gradio App execution
from app import app, max_queue_size, max_file_size # Replace with actual import if needed
if os.getenv("COGNITO_AUTH", "0") == "1":
app.queue(max_size=max_queue_size).launch(show_error=True, auth=app.authenticate_user, max_file_size=max_file_size)
else:
app.queue(max_size=max_queue_size).launch(show_error=True, inbrowser=True, max_file_size=max_file_size)