Update Gemma on Dataflow example to pass max_length as arg
Description
Passes the max_length parameter to Gemma's generate() call through inference_args rather than having a hard-coded option.
Checklist
- [ ] I have followed Sample Guidelines from AUTHORING_GUIDE.MD
- [ ] README is updated to include all relevant information
- [ ] Tests pass:
nox -s py-3.9(see Test Environment Setup) - [ ] Lint pass:
nox -s lint(see Test Environment Setup) - [ ] These samples need a new API enabled in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
- [ ] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
- [ ] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
- [ ] Please merge this PR for me once it is approved
Got a clean run using this version of the code on a different GCP project since the test runs here have been hitting compute quotas
We got this warning, although not the source of the errors:
/workspace/dataflow/gemma/custom_model_gemma.py:143: BeamDeprecationWarning: WriteStringsToPubSub is deprecated since 2.7.0. Use WriteToPubSub instead.
======================== 1 failed in 3607.33s (1:00:07) ========================
nox > Command pytest --junitxml=sponge_log.xml failed with exit code 1
nox > Session py-3.11 failed.
make: *** [Makefile:40: test] Error 1
err: signal: killed
Looks like tests failed due to timeout.
This might require updating to the latest branch, secrets have changed and it might be using an older image version.
@jrmccluskey per the earlier comment, this PR will need rebasing before test can run