fix demo service

This commit is contained in:
mengzhe.cmz 2023-03-22 11:21:39 +08:00
parent 1f0f44bd07
commit 586c7024ef
2 changed files with 1 additions and 2 deletions

View File

@ -13,7 +13,6 @@ logger.setLevel(logging.CRITICAL)
inference_pipeline = pipeline(
task=Tasks.punctuation,
model='damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727',
model_revision="v1.0.0",
output_dir="./tmp/"
)

View File

@ -69,6 +69,7 @@ class Text2Punc:
precache = "".join(cache)
else:
precache = ""
cache = []
data = {"text": precache + text}
result = self.preprocessor(data=data, uid="12938712838719")
split_text = self.preprocessor.pop_split_text_data(result)
@ -233,7 +234,6 @@ def inference_modelscope(
item = {'key': key, 'value': ""}
results.append(item)
return results
#import pdb;pdb.set_trace()
result, _, cache = text2punc(line, cache)
item = {'key': key, 'value': result, 'cache': cache}
results.append(item)