Fix output types with torch not installed
This commit is contained in:
parent
4e80e1b79a
commit
9c1a0fa2e5
|
@ -277,7 +277,8 @@ def handle_agent_output_types(output, output_type=None):
|
||||||
# If the class does not have defined output, then we map according to the type
|
# If the class does not have defined output, then we map according to the type
|
||||||
for _k, _v in INSTANCE_TYPE_MAPPING.items():
|
for _k, _v in INSTANCE_TYPE_MAPPING.items():
|
||||||
if isinstance(output, _k):
|
if isinstance(output, _k):
|
||||||
return _v(output)
|
if not isinstance(output, object): # avoid converting to audio if torch is not installed
|
||||||
|
return _v(output)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue