          available_vram = (cast(int, self._vram_stats["vram_free"])
                            - plugins_required) // len(gpu_plugins)
          self._set_plugin_batchsize(gpu_plugins, available_vram)
  
      def _set_plugin_batchsize(self, gpu_plugins: List[str], available_vram: float) -> None:
          """ Set the batch size for the given plugin based on given available vram.
          Do not update plugins which have a vram_per_batch of 0 (CPU plugins) due to
          zero division error.
          """
          plugins = [self._active_plugins[idx]
 
</s> remove         available_vram = (cast(int, self._vram_stats["vram_free"])
 </s> add         available_vram = (T.cast(int, self._vram_stats["vram_free"]) </s> remove                       plugin_type: Literal["align", "detect"],
 </s> add                       plugin_type: T.Literal["align", "detect"], </s> remove     def _scale_image(image: np.ndarray, image_size: Tuple[int, int], scale: float) -> np.ndarray:
 </s> add     def _scale_image(image: np.ndarray, image_size: tuple[int, int], scale: float) -> np.ndarray: </s> remove     def get_available_convert_plugins(convert_category: str, add_none: bool = True) -> List[str]:
 </s> add     def get_available_convert_plugins(convert_category: str, add_none: bool = True) -> list[str]: </s> remove         if plugins_required + batch_required <= cast(int, self._vram_stats["vram_free"]):
 </s> add         if plugins_required + batch_required <= T.cast(int, self._vram_stats["vram_free"]):
    def _set_plugin_batchsize(self, gpu_plugins: list[str], available_vram: float) -> None:
          available_vram = (cast(int, self._vram_stats["vram_free"])
                            - plugins_required) // len(gpu_plugins)
          self._set_plugin_batchsize(gpu_plugins, available_vram)
  
    def _set_plugin_batchsize(self, gpu_plugins: list[str], available_vram: float) -> None:
          """ Set the batch size for the given plugin based on given available vram.
          Do not update plugins which have a vram_per_batch of 0 (CPU plugins) due to
          zero division error.
          """
          plugins = [self._active_plugins[idx]
keep keep keep keep replace keep keep keep keep keep
 Rebase code (#1326)

* Remove tensorflow_probability requirement

* setup.py - fix progress bars

* requirements.txt: Remove pre python 3.9 packages

* update apple requirements.txt

* update INSTALL.md

* Remove python<3.9 code

* setup.py - fix Windows Installer

* typing: python3.9 compliant

* Update pytest and readthedocs python versions

* typing fixes

* Python Version updates
  - Reduce max version to 3.10
  - Default to 3.10 in installers
  - Remove incompatible 3.11 tests

* Update dependencies

* Downgrade imageio dep for Windows

* typing: merge optional unions and fixes

* Updates
  - min python version 3.10
  - typing to python 3.10 spec
  - remove pre-tf2.10 code
  - Add conda tests

* train: re-enable optimizer saving

* Update dockerfiles

* Update setup.py
  - Apple Conda deps to setup.py
  - Better Cuda + dependency handling

* bugfix: Patch logging to prevent Autograph errors

* Update dockerfiles

* Setup.py - Setup.py - stdout to utf-8

* Add more OSes to github Actions

* suppress mac-os end to end test 
plugins/extract/pipeline.py