__pycache__ | ||
endpoints | ||
flagged | ||
utils | ||
__init__.py | ||
.gitignore | ||
celery_debug.py | ||
celery_worker.py | ||
connect_rabbitmq.py | ||
Dockerfile | ||
locustfile.py | ||
main.py | ||
monitor.py | ||
multi-user.py | ||
nohup.out | ||
pipeline_setup.py | ||
prompt.txt | ||
README.md | ||
report.docx | ||
requirements.txt | ||
resource_usage.log | ||
tasks.py | ||
ui.py |
API Usage Guide
This project supports multiple methods to start and interact with the API.
Method 1: Standard API Start
Start the API using the main script:
python main.py
Method 2: Gradio UI
To use the Gradio UI:
- In the
endpoints/
directory, change the comment to enable 'gradio'. - Run the UI script:
python ui.py
Method 3: Celery Optimization
Use Celery for optimized background task processing. You can adjust the parameters for concurrency as needed.
Step 1: Start Redis Server
redis-server
Step 2: Start Celery Workers
Open two separate terminals and run the following:
Terminal 1 (Preprocessing Queue):
celery -A tasks worker --pool=threads --loglevel=info --concurrency=2 --queues=preprocess_queue
Terminal 2 (Inference Queue):
celery -A tasks worker --pool=threads --loglevel=info --concurrency=3 --queues=inference_queue
Step 3: Run Debug Script
python celery_debug.py