Fix problems with serializing audio output in serving (#993)

* fix audio out

* fix value in json output

* fix audio out

(cherry picked from commit d5c9c82340)
This commit is contained in:
suluyana
2024-09-18 08:48:20 +08:00
committed by yuze.zyz
parent 58bfe62e93
commit ac1d70ef0c

View File

@@ -787,7 +787,12 @@ def pipeline_output_to_service_base64_output(task_name, pipeline_output):
pipeline_output = pipeline_output[0]
for key, value in pipeline_output.items():
if key not in task_outputs:
json_serializable_output[key] = value
import torch
if isinstance(value, torch.Tensor):
v = np.array(value.cpu()).tolist()
else:
v = value
json_serializable_output[key] = v
continue # skip the output not defined.
if key in [
OutputKeys.OUTPUT_IMG, OutputKeys.OUTPUT_IMGS,