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

* fix audio out

* fix value in json output

* fix audio out
This commit is contained in:
suluyana
2024-09-18 08:48:20 +08:00
committed by GitHub
parent 74d97ea7e0
commit d5c9c82340

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,