From b6c1f5c7d976e0589c85ac9ba7033d8a137d6ca3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 9 Jan 2024 14:44:08 +0100 Subject: [PATCH] DEV: patchbot: produce a verdict for too long commit messages Some rare commit messages area really too large because they contain code excerpts in the message body or are release commits with their changelog. In this case, instead of leaving an empty file that will be silently ignored, let's produce an output message indicating that the verdict is uncertain, with an explanation stating that there was an error. --- dev/patchbot/scripts/process-patch-v15.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/patchbot/scripts/process-patch-v15.sh b/dev/patchbot/scripts/process-patch-v15.sh index 9b2eaa493..e9f718ab1 100755 --- a/dev/patchbot/scripts/process-patch-v15.sh +++ b/dev/patchbot/scripts/process-patch-v15.sh @@ -51,6 +51,13 @@ fi if [ -z "$INTERACTIVE" ]; then LANG=C "$MAINPROG" --log-disable --model "$MODEL" --threads "$CPU" --ctx_size 4096 --temp 0.36 --top_k 12 --top_p 1 --repeat_last_n 256 --batch_size 16384 --repeat_penalty 1.1 --n_predict 200 --multiline-input --prompt "$PROMPT" --prompt-cache "$CACHE" $CACHE_RO "$@" 2>&1 | grep -v ^llama_model_loader | grep -v ^llm_load_ > "${OUTPUT}" + if [ "$?" != 0 ]; then + # failed: this is likely because the text is too long + (echo "$PROMPT"; echo + echo "Explanation: the commit message was way too long, couldn't analyse it." + echo "Conclusion: uncertain" + echo) > "${OUTPUT}" + fi else LANG=C "$MAINPROG" --log-disable --model "$MODEL" --threads "$CPU" --ctx_size 4096 --temp 0.36 --repeat_penalty 1.1 --n_predict 200 --multiline-input --prompt "$PROMPT" --prompt-cache "$CACHE" $CACHE_RO -n -1 -i --color --in-prefix ' ' --reverse-prompt "$INTERACTIVE:" "$@" fi