agent-0 / patch_queue.py
Leon4gr45's picture
Upload folder using huggingface_hub (part 2)
8ae7da8 verified
Raw History Blame Contribute Delete
737 Bytes
with open("api.py", "r") as f:
content = f.read()
import re
content = re.sub(r'( if huey is None:\n raise HTTPException\(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable."\)\n)+', r' if huey is None:\n raise HTTPException(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable.")\n', content)
content = re.sub(r'( if huey is None:\n raise HTTPException\(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable."\)\n)+', r' if huey is None:\n raise HTTPException(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable.")\n', content)
with open("api.py", "w") as f:
f.write(content)