From 2cf4084b23db9bd9e8ce4db76d0628ef6655ed71 Mon Sep 17 00:00:00 2001
From: 夜雨飘零 <yeyupiaoling@foxmail.com>
Date: 星期六, 03 二月 2024 13:05:07 +0800
Subject: [PATCH] fix retract error (#1350)
---
runtime/python/http/server.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/runtime/python/http/server.py b/runtime/python/http/server.py
index e4930a2..c97ac63 100644
--- a/runtime/python/http/server.py
+++ b/runtime/python/http/server.py
@@ -4,6 +4,7 @@
import uuid
import aiofiles
+import ffmpeg
import uvicorn
from fastapi import FastAPI, File, UploadFile
from modelscope.utils.logger import get_logger
@@ -105,7 +106,6 @@
app = FastAPI(title="FunASR")
param_dict = {"sentence_timestamp": True, "batch_size_s": 300}
-
if args.hotword_path is not None and os.path.exists(args.hotword_path):
with open(args.hotword_path, 'r', encoding='utf-8') as f:
lines = f.readlines()
@@ -122,8 +122,7 @@
async with aiofiles.open(audio_path, 'wb') as out_file:
content = await audio.read()
await out_file.write(content)
-
- try:
+ try:
audio_bytes, _ = (
ffmpeg.input(audio_path, threads=0)
.output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=16000)
@@ -150,7 +149,6 @@
else:
logger.info(f'璇嗗埆缁撴灉锛歿rec_results}')
return {"msg": "鏈煡閿欒", "code": -1}
-
if __name__ == '__main__':
--
Gitblit v1.9.1