ribbit
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
will try to do so
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
the normal streaming works well, now we have 2 separate endpoints one to handle all non-streaming and one to handle all the streaming hahah
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
returned a generator still, same code ran on serverless. no log to prove that it's a generator tho but it has the same behavior as before when it casted all my outputs to be a generator, it returns a [] and empty stream when streamed.
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
thank you all
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
this code also returns a generator
I think it's just the way it is
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
because the change of the response type would disrupt other running services, i am to avoid that
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
i am very sure that this is not the case, tried and checked every other function, this stream function is a new addition to the code and before that (all the function above of the
stream_func
is the original code) no function ever coded to return a generator67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
this is how the invoke method is, i omitted irrelevant codes but that's generally how the function is.
I got endpoint from this line in the handler function, which will pass job into a validator function that simply check if my payload schema is ok. basically the inputted payload should look like this:
basically that function validates and extract the endpoint variable from my input payload
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
the
endpoint
's value is not stream_answer
, yet it always returns a generator67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
output
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
that's from the runpod local dev server log, the one that shows the output of the handler function
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
haha sorry was dizzy, i meant /run
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
sorry i can't produce screenshot right now, but in the local testing library, the output is somewhat like this:
assume that this is my code
it is expected if
something
is True
, but somehow when something
is False
, it returns a generator as well67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
i hit the /run endpoint first, then retrieve the stream by hitting /stream
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
yeah that's not how, i just wrote the example that way for convinience
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
sorry, I mean whenever a yield is present in the handler, the output becomes a generator regardless if I use yield or return. for example
67 replies
RRunPod
•Created by ribbit on 4/30/2024 in #⚡|serverless
How do I handle both streaming and non-streaming request in a serverless pod?
no unfortunately it's not easy to test locally, but I tried deploying it anyway and turns out whenever there's yield in the handler function everything I return becomes a generator? I can't get it to work yet
67 replies
RRunPod
•Created by ribbit on 4/17/2024 in #⚡|serverless
Connection reset by peer
yeah hahahah, things are ok up till now thanks all
34 replies
RRunPod
•Created by ribbit on 4/17/2024 in #⚡|serverless
Connection reset by peer
now it's stable, i think they fixed it
34 replies