daihui.zhang
commited on
Commit
·
65a4e8d
1
Parent(s):
c399ddb
update translate text check
Browse files
transcribe/pipelines/pipe_translate.py
CHANGED
|
@@ -16,8 +16,9 @@ class TranslatePipe(BasePipe):
|
|
| 16 |
|
| 17 |
def process(self, in_data: MetaItem) -> MetaItem:
|
| 18 |
context = in_data.transcribe_content
|
| 19 |
-
|
| 20 |
-
|
|
|
|
| 21 |
result = ""
|
| 22 |
else:
|
| 23 |
result = self.translator.translate(
|
|
|
|
| 16 |
|
| 17 |
def process(self, in_data: MetaItem) -> MetaItem:
|
| 18 |
context = in_data.transcribe_content
|
| 19 |
+
if not context.strip():
|
| 20 |
+
result = ""
|
| 21 |
+
elif all([ch in ALL_MARKERS for ch in context.strip()]):
|
| 22 |
result = ""
|
| 23 |
else:
|
| 24 |
result = self.translator.translate(
|