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 right now, in your predict function, your return a generator that yields non-string values, these values will not get streamed to a client. In fact, the client will just receive an empty response.
def predict(payload: Dict):
def inner():
for i in range(5):
yield i
return inner()
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Since pretty much any python object responds to str(), we should just coerce the user's results to a string. This will be much more predictable & clearer to the user when they've done something they haven't intended, as opposed to seeing an empty response.
Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.
Desktop (please complete the following information):
Describe the bug
If right now, in your predict function, your return a generator that yields non-string values, these values will not get streamed to a client. In fact, the client will just receive an empty response.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Since pretty much any python object responds to
str()
, we should just coerce the user's results to a string. This will be much more predictable & clearer to the user when they've done something they haven't intended, as opposed to seeing an empty response.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: