Skip to content

Commit 61932c3

Browse files
changdazhouTingquanGao
authored andcommitted
compatible with python3.9
1 parent 7905c55 commit 61932c3

File tree

1 file changed

+4
-4
lines changed
  • paddlex/inference/pipelines/paddleocr_vl

1 file changed

+4
-4
lines changed

paddlex/inference/pipelines/paddleocr_vl/uilts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re
1919
from collections import Counter
2020
from copy import deepcopy
21-
from typing import Any, Dict, List, Tuple
21+
from typing import Any, Dict, List, Tuple, Union
2222

2323
import numpy as np
2424
from PIL import Image
@@ -829,7 +829,7 @@ def convert_otsl_to_html(otsl_content: str):
829829
return export_to_html(table_data)
830830

831831

832-
def find_shortest_repeating_substring(s: str) -> str | None:
832+
def find_shortest_repeating_substring(s: str) -> Union[str, None]:
833833
"""
834834
Find the shortest substring that repeats to form the entire string.
835835
@@ -850,7 +850,7 @@ def find_shortest_repeating_substring(s: str) -> str | None:
850850

851851
def find_repeating_suffix(
852852
s: str, min_len: int = 8, min_repeats: int = 5
853-
) -> Tuple[str, str, int] | None:
853+
) -> Union[Tuple[str, str, int], None]:
854854
"""
855855
Detect if string ends with a repeating phrase.
856856
@@ -888,7 +888,7 @@ def truncate_repetitive_content(
888888
min_len (int): Min length for char-level check.
889889
890890
Returns:
891-
Tuple[str, str]: (truncated_content, info_string)
891+
Union[str, str]: (truncated_content, info_string)
892892
"""
893893
stripped_content = content.strip()
894894
if not stripped_content:

0 commit comments

Comments
 (0)