Spaces:
Sleeping
Sleeping
Chandima Prabhath
Fix worker process path in run.py; add worker.py for dedicated worker handling
89c32de Download run.py from Hans-R-D/encoder-pipeline: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/spaces/Hans-R-D/encoder-pipeline/resolve/main/run.py
- Command line
-
hf download hf://spaces/Hans-R-D/encoder-pipeline/run.py
-
curl -L -o run.py https://huggingface.co/spaces/Hans-R-D/encoder-pipeline/resolve/main/run.py
530 Bytes
| import uvicorn | |
| from video_encoder.api.main import app | |
| from rq import Worker, Queue | |
| from redis import Redis | |
| from video_encoder.config import RedisConfig | |
| import subprocess | |
| import uvicorn | |
| from video_encoder.api.main import app | |
| if __name__ == "__main__": | |
| # Start worker in separate process | |
| worker_process = subprocess.Popen(["python", "video_encoder/worker/worker.py"]) | |
| try: | |
| # Start API server | |
| uvicorn.run(app, host="0.0.0.0", port=7860, log_config=None) | |
| finally: | |
| worker_process.terminate() | |