Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packaging/install_torchdata.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
package_type="$PACKAGE_TYPE"
channel="$CHANNEL"
channel="$CHANNEl"
if [ -z "$package_type" ]; then
package_type="wheel"
fi
Expand Down Expand Up @@ -33,7 +33,14 @@ $install_cmd torchdata $install_channel
if [ "$package_type" = "wheel" ]; then
TORCHDATA_VERSION="$(pip show torchdata | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')"
else
TORCHDATA_VERSION="$(conda list -fe torchdata | grep torchdata | sed -e 's/torchdata=\(.*\)=py.*/\1/')"
TORCHDATA_VERSION="$(conda search --json 'torchdata[channel=pytorch-'"${channel}"] | \
python -c "import json, os, re, sys; \
cuver = 'cpu'; \
pyver = os.environ.get('PYTHON_VERSION').replace('.', ''); \
print(re.sub(r'\\+.*$', '',
[x['version'] for x in json.load(sys.stdin)['torchdata'] \
if 'py' + pyver in x['fn']][-1]))"
)"
echo "export CONDA_TORCHDATA_CONSTRAINT='- torchdata==${TORCHDATA_VERSION}'" >> "${BUILD_ENV_FILE}"
fi

Expand Down