Spaces:
Runtime error
Runtime error
Download workers/converter_worker.py from cloudaiRambo/cloudairambo: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/spaces/cloudaiRambo/cloudairambo/resolve/main/workers/converter_worker.py
- Command line
-
hf download hf://spaces/cloudaiRambo/cloudairambo/workers/converter_worker.py
-
curl -L -o converter_worker.py https://huggingface.co/spaces/cloudaiRambo/cloudairambo/resolve/main/workers/converter_worker.py
675 Bytes
| from celery_app import celery_app | |
| from services.universal_converter_service import convert_file | |
| def convert_task(self, input_path: str, target_ext: str): | |
| try: | |
| # 🔴 IMPORTANT: tell Celery we started | |
| self.update_state(state="PROCESSING") | |
| output_path = convert_file(input_path, target_ext) | |
| # ✅ FINAL RESULT (this is what AsyncResult.result returns) | |
| return { | |
| "status": "done", | |
| "output_path": output_path | |
| } | |
| except Exception as e: | |
| return { | |
| "status": "failed", | |
| "error": str(e) | |
| } | |