Download fix_worker_api.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 403 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/fix_worker_api.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/fix_worker_api.py
-
curl -L -o fix_worker_api.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/fix_worker_api.py
403 Bytes
| with open("ocr/worker_api.py", "r") as f: | |
| text = f.read() | |
| # I see the user has `OPENAI_COMPATIBLE_API` set as a secret, not `OPENAI_COMPATIBLE_KEY`! | |
| # Let's change `OPENAI_COMPATIBLE_KEY` to `OPENAI_COMPATIBLE_API` | |
| text = text.replace('openai_key = os.getenv("OPENAI_COMPATIBLE_KEY")', 'openai_key = os.getenv("OPENAI_COMPATIBLE_API")') | |
| with open("ocr/worker_api.py", "w") as f: | |
| f.write(text) | |