feat: update granite library examples to use Granite 4.1 3B adapters.#981
Conversation
The commented-out code in intrinsics.py still needs to be changed. Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
| # model. See docs/examples/granite-switch/ for a full runnable example. | ||
| # from mellea.backends.openai import OpenAIBackend | ||
| # from mellea.backends.model_ids import IBM_GRANITE_SWITCH_4_1_3B | ||
| # from mellea.backends.model_ids import IBM_GRANITE_4_1_3B |
There was a problem hiding this comment.
This commented out one is supposed to be a SWITCH alternative. I'm thinking this was a search/replace mistake.
If you intentionally did rename switch -> 4.1 3B, then the other commented references below were missed. Also the alternative would probably not be needed anymore or at least need different comments that explain.
There was a problem hiding this comment.
Yeah, the commented-out code in intrinsics.py still needs to be changed.
There was a problem hiding this comment.
reverted that line thanks for catching.
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
|
We're waiting to merge this one until all of the 4.1 library models are in the HF ibm-granite granite library collection repos. |
|
|
|
For |
planetf1
left a comment
There was a problem hiding this comment.
A few other things I noticed - unsure if this is out of scope of this pr and/or will be addressed on another issue/pr ?
- AGENTS.md still refers to the granite-4.0-micro model
- similar in various places in our published docs
- does the start_backend default need updating ? (it's granite 4 for now)
- I don't see granite-4.1:3b in the BASE_MODEL_TO_CANONICAL_NAME - no sign of granite-4.1-3b there yet?
* context_relevance: use 4.0 and leave comment explaining why. * requirement check: switch to 4.1 * uncertainty: switch to 4.1 Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
long-term it probably makes sense to add another column to the intrinsics list. Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
|
Thanks, @planetf1 !
Yes; fixed.
They're being staged; those will exist for 4.1 prior to release. The context_relevance intrinsic will not exist for 4.1, so I reverted that example to 4.0.
Fixed.
@planetf1 what repos should I be sweeping (in addition to this one)?
This was already done by #964; I just hadn't merged main in a minute.
Done. |
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
|
Current status: there are three examples still failing:
|
|
Saving a helper script here for the next release. Drop in the intrinsics dir; runs all of the local examples. Gives a tighter ooda than waiting on nightlies. #!/usr/bin/env bash
set -uo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
entries="["
first=true
for py_file in "$SCRIPT_DIR"/*.py; do
echo $py_file;
filename="$(basename "$py_file")"
stdout="$(uv run python "$py_file" 2>/tmp/_intrinsic_stderr)"
exit_code=$?
stderr="$(cat /tmp/_intrinsic_stderr)"
entry="$(python3 -c "
import json, sys
print(json.dumps({
'file': sys.argv[1],
'exit_code': int(sys.argv[2]),
'stdout': sys.argv[3],
'stderr': sys.argv[4],
}))" "$filename" "$exit_code" "$stdout" "$stderr")"
if [ "$first" = true ]; then
first=false
else
entries+=", "
fi
entries+="$entry"
done
entries+="]"
echo "$entries" > "$SCRIPT_DIR/run_outputs.json"one-liner to get failed tests: python3 -c "import json
print('Failures:\n *','\n * '.join([failed['file'] for failed in json.load(open('run_outputs.json', 'r')) if failed['exit_code'] != 0]))" |
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Nathan Fulton <gitcommit@nfulton.org>
Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
Misc PR
Type of PR
Description
Testing
Attribution