'commit'
This commit is contained in:
@@ -4,8 +4,7 @@ import uuid
|
||||
import tempfile
|
||||
import shutil
|
||||
import sys
|
||||
import logging
|
||||
from fastapi import APIRouter, UploadFile, File
|
||||
from fastapi import APIRouter, UploadFile, File, Form
|
||||
|
||||
# 配置日志
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -20,7 +19,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
|
||||
from Config.Config import XF_APPID, XF_APIKEY, XF_APISECRET
|
||||
|
||||
@router.post("/save-audio")
|
||||
async def save_audio(audio: UploadFile = File(...)):
|
||||
async def save_audio(audio: UploadFile = File(...), txt: str = Form(...)):
|
||||
"""保存音频文件并评分"""
|
||||
temp_file = None
|
||||
try:
|
||||
@@ -45,7 +44,8 @@ async def save_audio(audio: UploadFile = File(...)):
|
||||
api_key=XF_APIKEY,
|
||||
api_secret=XF_APISECRET,
|
||||
audio_file=temp_file,
|
||||
language="english"
|
||||
language="english",
|
||||
txt=txt
|
||||
)
|
||||
results, eval_time = evaluator.run_evaluation()
|
||||
print(evaluator.get_evaluation_summary())
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user