Dear SpaCy Team,
I am currently working on a project that involves using Prodigy with a SpaCy project (weasel), and I've encountered a challenge in setting up environment variables.
I am using the weasel run <command>
to execute a Prodigy recipe with the PRODIGY_ALLOWED_SESSIONS
variable.
My project.yml
file is defined as follows:
...
env:
PRODIGY_ALLOWED_SESSIONS: "user_1,user_2,user_3"
...
commands:
- name: "man"
help: "Start the Prodigy manual annotation recipe"
script:
- "echo PRODIGY_ALLOWED_SESSIONS=${env.PRODIGY_ALLOWED_SESSIONS}"
- "python -m prodigy textcat.manual ${vars.database} assets/${vars.document_paths} --label ${vars.labels}"
...
When I execute the weasel run man
command, here is my output:
==================================== man ====================================
Running command: echo PRODIGY_ALLOWED_SESSIONS=
PRODIGY_ALLOWED_SESSIONS=
Running command: /opt/homebrew/Caskroom/miniforge/base/envs/annotations/bin/python3.11 -m prodigy textcat.manual ...
Using 11 label(s): ...
✨ Starting the web server at http://localhost:8080 ...
Open the app in your browser and start annotating!
As you can see, the PRODIGY_ALLOWED_SESSIONS
environment variable is not being injected correctly.
I also tried using a vars
variable, but that resulted in an error like:
Running command: PRODIGY_ALLOWED_SESSIONS=user_1,user_2,user_3 python -m prodigy textcat.manual ...'
Traceback (most recent call last):
...
FileNotFoundError: [E501] Can not execute command 'PRODIGY_ALLOWED_SESSIONS=user_1,user_2,user_3 python -m prodigy textcat.manual ...
Do you have 'PRODIGY_ALLOWED_SESSIONS=user_1,user_2,user_3' installed?
How am I supposed to inject an environment variable like PRODIGY_ALLOWED_SESSIONS
in a weasel project?
Thank you for your assistance.