Skip to content

Commit

Permalink
Fix oss unit test in Python 3.9 for calibrator.py.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 648415418
  • Loading branch information
Google AI Edge authored and copybara-github committed Jul 1, 2024
1 parent 648527c commit 32ad0cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ai_edge_quantizer/calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections.abc import Iterable
import copy
from typing import Any
from typing import Any, Optional, Union

from absl import logging

Expand All @@ -20,7 +20,7 @@ class Calibrator:

def __init__(
self,
float_tflite: str | bytearray,
float_tflite: Union[str, bytearray],
):
self._flatbuffer_model = tfl_flatbuffer_utils.read_model(float_tflite)
self._tfl_interpreter = tfl_interpreter_utils.create_tfl_interpreter(
Expand All @@ -36,7 +36,7 @@ def calibrate(
self,
calibration_dataset: Iterable[_SignatureInput],
model_recipe_manager: recipe_manager.RecipeManager,
signature_key: str | None = None,
signature_key: Optional[str] = None,
) -> None:
"""Calibrates the model using the given dataset for a model signature.
Expand Down

0 comments on commit 32ad0cf

Please sign in to comment.