1een commited on
Commit
b7bc2ec
·
1 Parent(s): 3bced8d
Files changed (2) hide show
  1. fixed_app.py +2 -2
  2. startup.sh +1 -1
fixed_app.py CHANGED
@@ -240,7 +240,7 @@ async def transcribe_audio(request: AudioRequest):
240
  "-l", request.language or "auto",
241
  "-oj", # --output-json: 输出JSON格式
242
  "-of", output_file, # 指定输出文件
243
- "-t", str(os.cpu_count()), # 使用所有CPU核心
244
  "-bs", "1", # beam size = 1 (最快)
245
  "-bo", "1", # best of = 1 (最快)
246
  "-ac", "0", # 音频上下文 = 0 (最快)
@@ -312,7 +312,7 @@ async def transcribe_audio(request: AudioRequest):
312
 
313
  # 读取JSON输出文件
314
  result = parse_whisper_output(output_file, stdout, exit_code)
315
- result["processing_time"] = processing_time
316
 
317
  return result
318
 
 
240
  "-l", request.language or "auto",
241
  "-oj", # --output-json: 输出JSON格式
242
  "-of", output_file, # 指定输出文件
243
+ "-t", str(int(os.cpu_count()/2)), # 使用所有CPU核心
244
  "-bs", "1", # beam size = 1 (最快)
245
  "-bo", "1", # best of = 1 (最快)
246
  "-ac", "0", # 音频上下文 = 0 (最快)
 
312
 
313
  # 读取JSON输出文件
314
  result = parse_whisper_output(output_file, stdout, exit_code)
315
+ result["processing_time"] = f"{processing_time:.2f}"
316
 
317
  return result
318
 
startup.sh CHANGED
@@ -1,7 +1,7 @@
1
  #!/bin/bash
2
 
3
  # 显示环境信息
4
- echo "=== Whisper API Startup 0.3==="
5
  echo "Python version: $(python3 --version)"
6
  echo "Current directory: $(pwd)"
7
  # echo "Files in /app:"
 
1
  #!/bin/bash
2
 
3
  # 显示环境信息
4
+ echo "=== Whisper API Startup 0.4==="
5
  echo "Python version: $(python3 --version)"
6
  echo "Current directory: $(pwd)"
7
  # echo "Files in /app:"