From 111450d5e67ed01e3e7de088fe5bb3115dc7eeff Mon Sep 17 00:00:00 2001
From: mengzhe.cmz <mengzhe.cmz@alibaba-inc.com>
Date: 星期四, 23 三月 2023 19:55:15 +0800
Subject: [PATCH] update infer.py
---
funasr/bin/vad_inference_online.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/funasr/bin/vad_inference_online.py b/funasr/bin/vad_inference_online.py
index d18488e..faee1fc 100644
--- a/funasr/bin/vad_inference_online.py
+++ b/funasr/bin/vad_inference_online.py
@@ -1,5 +1,6 @@
import argparse
import logging
+import os
import sys
import json
from pathlib import Path
@@ -237,7 +238,8 @@
if results:
for i, _ in enumerate(keys):
if results[i]:
- results[i] = json.dumps(results[i])
+ if "MODELSCOPE_ENVIRONMENT" in os.environ and os.environ["MODELSCOPE_ENVIRONMENT"] == "eas":
+ results[i] = json.dumps(results[i])
item = {'key': keys[i], 'value': results[i]}
vad_results.append(item)
if writer is not None:
--
Gitblit v1.9.1