File size: 403 Bytes
42da440
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
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)