You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user yields some complex object that is not bytes or string in a generator response, it can lead to strange errors. For instance, if you yield a numpy array, you get this exception:
Aug 16 6:14:28pm
Exception while reading stream response: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Traceback (most recent call last):
File "/app/model_wrapper.py", line 249, in write_response_to_queue
async for chunk in generator:
File "/app/model_wrapper.py", line 351, in _convert_generator_to_async
if chunk == FINAL_GENERATOR_VALUE:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
To Reproduce
Yield a numpy array from a generator returned from the predict method.
Expected behavior
We should throw exception if the user yields something that isn't bytes or a string.
Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.
Desktop (please complete the following information):
Describe the bug
If the user yields some complex object that is not bytes or string in a generator response, it can lead to strange errors. For instance, if you yield a numpy array, you get this exception:
To Reproduce
Yield a numpy array from a generator returned from the
predict
method.Expected behavior
We should throw exception if the user yields something that isn't bytes or a string.
Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: