"...git@developer.sourcefind.cn:modelzoo/qwen_lmdeploy.git" did not exist on "0d2a151ec81344e81fd345f3e53edd65ff856d5b"
Unverified Commit 7d7fe499 authored by Funtowicz Morgan's avatar Funtowicz Morgan Committed by GitHub
Browse files

Allow BatchEncoding to be initialized empty. (#4316)

* Allow BatchEncoding to be initialized empty.

This is required by recent changes introduced in TF 2.2.

* Attempt to unpin Tensorflow to 2.2 with the previous commit.
parent 0a97f631
...@@ -67,8 +67,8 @@ extras = {} ...@@ -67,8 +67,8 @@ extras = {}
extras["mecab"] = ["mecab-python3"] extras["mecab"] = ["mecab-python3"]
extras["sklearn"] = ["scikit-learn"] extras["sklearn"] = ["scikit-learn"]
extras["tf"] = ["tensorflow <= 2.1"] extras["tf"] = ["tensorflow"]
extras["tf-cpu"] = ["tensorflow-cpu <= 2.1"] extras["tf-cpu"] = ["tensorflow-cpu"]
extras["torch"] = ["torch"] extras["torch"] = ["torch"]
extras["serving"] = ["pydantic", "uvicorn", "fastapi", "starlette"] extras["serving"] = ["pydantic", "uvicorn", "fastapi", "starlette"]
......
...@@ -173,7 +173,11 @@ class BatchEncoding(UserDict): ...@@ -173,7 +173,11 @@ class BatchEncoding(UserDict):
""" """
def __init__(self, data: Dict[str, Any], encoding: Optional[Union[EncodingFast, Sequence[EncodingFast]]] = None): def __init__(
self,
data: Optional[Dict[str, Any]] = None,
encoding: Optional[Union[EncodingFast, Sequence[EncodingFast]]] = None,
):
super().__init__(data) super().__init__(data)
if isinstance(encoding, EncodingFast): if isinstance(encoding, EncodingFast):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment