Skip to content

Commit

Permalink
Fix FLAML installation problems, support version >=2 (#626)
Browse files Browse the repository at this point in the history
FLAML was fixed to <2, and would install an incompatible xgboost
version. This patch makes it so that newer versions of FLAML
can be installed. Additionally, when installing an older version
a compatible version of xgboost is installed.
Finally, it adds a definition of flaml:latest in line with the
other framework definitions.
  • Loading branch information
PGijsbers authored Jun 25, 2024
1 parent f4aa676 commit 077200e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions frameworks/flaml/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pandas<3
14 changes: 8 additions & 6 deletions frameworks/flaml/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ PKG=${3:-"flaml"}

. ${HERE}/../shared/setup.sh ${HERE} true

OPTIONALS="[automl]"
if [[ "$VERSION" == "latest" ]]; then
VERSION="main"
OPTIONALS=""
fi

if [[ "$VERSION" == "benchmark" ]]; then
VERSION="stable"
OPTIONALS="[catboost]"
OPTIONALS="[automl, catboost]"
else
PIP uninstall -y catboost
fi


if [[ "$VERSION" == "stable" ]]; then
PIP install --no-cache-dir -U "${PKG}${OPTIONALS}<2"
elif [[ "$VERSION" =~ ^[0-9] ]]; then
PIP install --no-cache-dir -U "${PKG}${OPTIONALS}"
elif [[ "$VERSION" =~ ^[0-1] ]]; then
PIP install --no-cache-dir -U ${PKG}${OPTIONALS}==${VERSION}
# FLAML 1.2.4 does not work with newer versions of xgboost
PIP install "xgboost<2"
elif [[ "$VERSION" =~ ^[2-9] ]]; then
PIP install --no-cache-dir -U ${PKG}${OPTIONALS}==${VERSION}
else
# PIP install --no-cache-dir -e git+${REPO}@${VERSION}#egg=${PKG}
TARGET_DIR="${HERE}/lib/${PKG}"
rm -Rf ${TARGET_DIR}
git clone --depth 1 --single-branch --branch ${VERSION} --recurse-submodules ${REPO} ${TARGET_DIR}
Expand Down
3 changes: 3 additions & 0 deletions resources/frameworks_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ autosklearn2:
AutoWEKA:
version: 'latest'

flaml:
version: 'latest'

GAMA:
version: 'latest'

Expand Down

0 comments on commit 077200e

Please sign in to comment.