93
Browse files- fixed_app.py +2 -2
- startup.sh +1 -1
fixed_app.py
CHANGED
|
@@ -192,7 +192,7 @@ def parse_whisper_output(output_file: str, stdout: bytes, exit_code: int) -> dic
|
|
| 192 |
result = {}
|
| 193 |
if os.path.exists(json_output_file):
|
| 194 |
try:
|
| 195 |
-
with open(json_output_file, 'r', encoding='utf-8') as f:
|
| 196 |
result = json.loads(f.read())
|
| 197 |
result["full_text"] = "".join([item["text"] for item in result.get("transcription", [])])
|
| 198 |
logger.info(f"成功读取JSON输出文件: {json_output_file}")
|
|
@@ -203,7 +203,7 @@ def parse_whisper_output(output_file: str, stdout: bytes, exit_code: int) -> dic
|
|
| 203 |
# 如果没有JSON输出,使用命令行输出
|
| 204 |
logger.warning(f"未找到JSON输出文件: {json_output_file}")
|
| 205 |
result = {
|
| 206 |
-
"text": stdout.decode(), # 使用stdout作为文本输出
|
| 207 |
"status": "completed" if exit_code == 0 else "failed",
|
| 208 |
"exit_code": exit_code
|
| 209 |
}
|
|
|
|
| 192 |
result = {}
|
| 193 |
if os.path.exists(json_output_file):
|
| 194 |
try:
|
| 195 |
+
with open(json_output_file, 'r', encoding='utf-8', errors='replace') as f:
|
| 196 |
result = json.loads(f.read())
|
| 197 |
result["full_text"] = "".join([item["text"] for item in result.get("transcription", [])])
|
| 198 |
logger.info(f"成功读取JSON输出文件: {json_output_file}")
|
|
|
|
| 203 |
# 如果没有JSON输出,使用命令行输出
|
| 204 |
logger.warning(f"未找到JSON输出文件: {json_output_file}")
|
| 205 |
result = {
|
| 206 |
+
"text": stdout.decode(errors='replace'), # 使用stdout作为文本输出
|
| 207 |
"status": "completed" if exit_code == 0 else "failed",
|
| 208 |
"exit_code": exit_code
|
| 209 |
}
|
startup.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
# 显示环境信息
|
| 4 |
-
echo "=== Whisper API Startup 0.
|
| 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.93==="
|
| 5 |
echo "Python version: $(python3 --version)"
|
| 6 |
echo "Current directory: $(pwd)"
|
| 7 |
# echo "Files in /app:"
|