mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 04:29:22 +01:00
fix(audio ans pipeline): Restore file reading from string input in ANSZip… (#1055)
* fix(audio pipeline): Restore file reading from string input in ANSZipEnhancerPipeline Fix the code to support various types of input, including local or remote URLs. Co-authored-by: Haoxu Wang <wanghaoxu.whx@alibaba-inc.com>
This commit is contained in:
@@ -151,9 +151,8 @@ class ANSZipEnhancerPipeline(Pipeline):
|
||||
if isinstance(inputs, bytes):
|
||||
data1, fs = sf.read(io.BytesIO(inputs))
|
||||
elif isinstance(inputs, str):
|
||||
# file_bytes = File.read(inputs)
|
||||
# data1, fs = sf.read(io.BytesIO(file_bytes))
|
||||
data1, fs = sf.read(inputs)
|
||||
file_bytes = File.read(inputs)
|
||||
data1, fs = sf.read(io.BytesIO(file_bytes))
|
||||
else:
|
||||
raise TypeError(f'Unsupported type {type(inputs)}.')
|
||||
if len(data1.shape) > 1:
|
||||
|
||||
Reference in New Issue
Block a user