Skip to content

Minor changes to pareval script #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2025
Merged
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
21 changes: 13 additions & 8 deletions bin/pareval
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Commands:
# generate - Generate LLM outputs for ParEval. See generate/generate.py for full argument list.
# evaluate - Evaluate LLM outputs for ParEval. See evaluate/evaluate.py for full argument list.
# evaluate - Evaluate LLM outputs for ParEval. See drivers/run-all.py for full argument list.
# help | -h | --help - Show a help message.
# version | -v | --version - Show the version of ParEval.

Expand All @@ -16,6 +16,11 @@ if [[ "$#" -eq 0 ]]; then
exit 1
fi

if [[ -z "$PAREVAL_ROOT" ]]; then
PAREVAL_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
fi


command="$1"
shift

Expand All @@ -33,7 +38,7 @@ case "$command" in
echo ""
echo "Commands:"
echo " generate Generate LLM outputs for ParEval. See generate/generate.py for full argument list."
echo " evaluate Evaluate LLM outputs for ParEval. See evaluate/evaluate.py for full argument list."
echo " evaluate Evaluate LLM outputs for ParEval. See drivers/run-all.py for full argument list."
echo " help Show this help message."
echo " -h, --help Show this help message."
echo " version Show the version of ParEval."
Expand Down Expand Up @@ -64,21 +69,21 @@ fi
# generate mode
if [[ "$MODE" == "generate" ]]; then
# Check if the generate script exists
if [[ ! -f "generate/generate.py" ]]; then
echo "Error: generate script not found. Please ensure you are in the correct directory."
if [[ ! -f "${PAREVAL_ROOT}/generate/generate.py" ]]; then
echo "Error: generate script not found in '${PAREVAL_ROOT}'. Please ensure you are in the correct directory."
exit 1
fi

python generate/generate.py "$@"
python ${PAREVAL_ROOT}/generate/generate.py "$@"
fi

# evaluate mode
if [[ "$MODE" == "evaluate" ]]; then
# Check if the evaluate script exists
if [[ ! -f "drivers/run-all.py" ]]; then
echo "Error: evaluate script not found. Please ensure you are in the correct directory."
if [[ ! -f "${PAREVAL_ROOT}/drivers/run-all.py" ]]; then
echo "Error: evaluate script not found '${PAREVAL_ROOT}'. Please ensure you are in the correct directory."
exit 1
fi

python3 drivers/run-all.py "$@"
python ${PAREVAL_ROOT}/drivers/run-all.py "$@"
fi