Skip to content

Commit 7cf35a9

Browse files
authored
handle conda location (#116)
1 parent 3a64d8b commit 7cf35a9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

setup/run.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,14 @@ for method in ${LLMDBENCH_DEPLOY_METHODS//,/ }; do
368368

369369
if [[ $LLMDBENCH_RUN_EXPERIMENT_ANALYZE_LOCALLY -eq 1 ]]; then
370370
announce "🔍 Analyzing collected data..."
371-
if [ "$LLMDBENCH_CONTROL_DEPLOY_HOST_OS" = "mac" ] && [ -f "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh" ]; then
372-
llmdbench_execute_cmd "source \"/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh\"" ${LLMDBENCH_CONTROL_DRY_RUN} ${LLMDBENCH_CONTROL_VERBOSE}
373-
elif [ "$LLMDBENCH_CONTROL_DEPLOY_HOST_OS" = "linux" ] && [ -f "/opt/miniconda/etc/profile.d/conda.sh" ]; then
374-
llmdbench_execute_cmd "source \"/opt/miniconda/etc/profile.d/conda.sh\"" ${LLMDBENCH_CONTROL_DRY_RUN} ${LLMDBENCH_CONTROL_VERBOSE}
371+
conda_root="$(conda info --all --json | jq -r '.root_prefix' 2>/dev/null)"
372+
if [ "$LLMDBENCH_CONTROL_DEPLOY_HOST_OS" = "mac" ]; then
373+
conda_sh="${conda_root}/base/etc/profile.d/conda.sh"
374+
else
375+
conda_sh="${conda_root}/etc/profile.d/conda.sh"
376+
fi
377+
if [ -f "${conda_sh}" ]; then
378+
llmdbench_execute_cmd "source \"${conda_sh}\"" ${LLMDBENCH_CONTROL_DRY_RUN} ${LLMDBENCH_CONTROL_VERBOSE}
375379
else
376380
announce "❌ Could not find conda.sh for $LLMDBENCH_CONTROL_DEPLOY_HOST_OS. Please verify your Anaconda installation."
377381
exit 1

0 commit comments

Comments
 (0)