Closed forrest-lam closed 8 months ago
If you are using python 3.8, I'd recommend to rewrite line 1135 as:
def forward(self, batch: Dict, force_zero_embeddings: List = None) -> Dict:
There are other lines which complains about the same error, which is caused by the version of python, you can rewrite them as well.
In Python 3.10 and higher versions, you can use | symbols to represent the type joint (for example, the List | None said parameter can be a List type or None type), but in Python 3.9 and the following version that is not supported.
python 3.8.16 error: