Update python to 3.11
- Update python to 3.11. We target the version that is available in debian bookworm
- use the cpu source for pytorch as done in other services and mark it as optional. This allows us to override the version if needed in inference-services repo.
- Add torch in extras in pyproject toml so that we can install it with
poetry install --extras torchand change the setup script to reflect this change -- otherwise we'd get an error in ci because of the missing torch package - Add
ignore_missing_imports = trueto[tool.mypy]inpyproject.tomlto silence missing type stubs for external libs like torch.
Bug: T400352