View source: R/reticulate_env.R
| python_requirements | R Documentation |
Returns the Python requirements that transforEmotion installs, in
requirements.txt format. Use it to build a fixed Python environment,
for example in a container image, and point transforEmotion at it with the
TRANSFOREMOTION_PYTHON environment variable (see Details).
python_requirements(
extras = character(),
gpu = FALSE,
sysname = Sys.info()[["sysname"]],
machine = Sys.info()[["machine"]]
)
extras |
Character vector of optional feature sets to include; see
|
gpu |
Logical. Use the CUDA build of PyTorch (Linux and Windows) instead of the CPU build. |
sysname, machine |
Target operating system and architecture, as
returned by |
The PyTorch requirements are direct wheel URLs built for Python 3.12, so the environment must use Python 3.12.
When TRANSFOREMOTION_PYTHON is set to a Python executable,
transforEmotion uses that interpreter and does not install anything. This is
the route for read-only environments such as Apptainer images, where uv
cannot write to its cache.
A character vector of requirement specifiers.
# Requirements for a CPU environment with the rag() packages
python_requirements(extras = "rag")
## Not run:
# Write a requirements file and build the environment with uv (shell):
# uv venv --python 3.12 /opt/te-venv
# uv pip install --python /opt/te-venv/bin/python -r requirements.txt
writeLines(python_requirements(extras = "rag"), "requirements.txt")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.