folding-final-handler / requirements.txt
riklo's picture
requirements: use absolute /repository/shim path (pip cwd isnt /repository on HFIE)
6364dfc verified
Raw
History Blame Contribute Delete
1.3 kB
# HFIE stock Python 3.11 container ships torch + transformers + HF
# inference toolkit pre-baked. We override transformers to the version
# lerobot[pi]==0.5.1 was built against and pin the safe datasets release
# (4.8.x imports BucketNotFoundError which only exists on hub `main`).
#
# lerobot 0.5.1 declares requires-python>=3.12 in its metadata. The
# patch_lerobot_for_py311.py script in this repo rewrites the four
# PEP 695 sites so the code itself runs on 3.11, but pip's metadata
# check still fails by default. Set PIP_IGNORE_REQUIRES_PYTHON=1 in the
# endpoint's environment variables (HFIE config) to skip it.
#
# The shim package drops a .pth file into site-packages that re-exports
# the names the HF inference toolkit imports from transformers.file_utils
# (`is_tf_available`, `is_torch_available`). transformers 5.x dropped
# `is_tf_available` entirely (TF support removed). Without the shim the
# toolkit's webservice_starlette fails to start before our handler.py is
# ever loaded.
#
# Note: HFIE's pip install runs from a cwd OTHER than /repository, so
# `./shim` doesn't resolve. We use the absolute /repository/shim path
# (HFIE-specific: the runtime always mounts the model repo there).
/repository/shim
transformers==5.3.0
datasets==4.7.0
huggingface_hub>=0.36
lerobot==0.5.1