|
| 1 | +--- |
| 2 | +title: "ML Dependency Extras" |
| 3 | +--- |
| 4 | +<!-- |
| 5 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +you may not use this file except in compliance with the License. |
| 7 | +You may obtain a copy of the License at |
| 8 | +
|
| 9 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +See the License for the specific language governing permissions and |
| 15 | +limitations under the License. |
| 16 | +--> |
| 17 | + |
| 18 | +# ML Dependency Extras |
| 19 | + |
| 20 | +In order to make it easy to make sure you are using dependencies which have |
| 21 | +been well tested with Beam ML, Beam provides a set of ML extras which can |
| 22 | +be installed alongside of Beam. For example, if you want to use a version |
| 23 | +of PyTorch which has been tested with Beam, you can install it with: |
| 24 | + |
| 25 | +``` |
| 26 | +pip install beam[torch] |
| 27 | +``` |
| 28 | + |
| 29 | +A full set of extras can be found in |
| 30 | +[setup.py](https://github.com/apache/beam/blob/6e3cf2b113026e27db7833a1f0fd08977b7c71e1/sdks/python/setup.py#L397). |
| 31 | + |
| 32 | +**Note:** You can also pin to dependencies outside of the extra range with |
| 33 | +a normal install - for example: |
| 34 | + |
| 35 | +``` |
| 36 | +pip install beam==2.XX.0 |
| 37 | +pip install torch==<version released after Beam 2.XX.0> |
| 38 | +``` |
| 39 | + |
| 40 | +this will usually work, but can break if the dependency releases a breaking |
| 41 | +change between the version Beam tests with and the version you pin to. |
0 commit comments