R
RunPod9mo ago
abtx

How do I write handler for /run

When I create a handler runpod.serverless.start({"handler": async_generator_handler}) Only http://localhost:8000/runsync triggers async_generator_handler However when posting against http://localhost:8000/run async_generator_handleris not triggered. Just returns
{"id":"test-20023617-4048-4f73-9511-8ae17a1ad7a5","status":"IN_PROGRESS"}
{"id":"test-20023617-4048-4f73-9511-8ae17a1ad7a5","status":"IN_PROGRESS"}
But nothing happens in the backend
6 Replies
justin
justin9mo ago
Local testing for runpod isn't that good. You write a handler just as a normal function Just you can really only test the /status to see the response when live Your best bet is just test with run-sync locally and if run-sync works, your /run will work
justin
justin9mo ago
GitHub
GitHub - justinwlin/runpodWhisperx: Runpod WhisperX Docker Containe...
Runpod WhisperX Docker Container Repo. Contribute to justinwlin/runpodWhisperx development by creating an account on GitHub.
GitHub
GitHub - justinwlin/runpod_whisperx_serverless_clientside_code: Hel...
Helper functions for Runpod to automatically poll my WhisperX API. Can be adapted to other use cases - justinwlin/runpod_whisperx_serverless_clientside_code
justin
justin9mo ago
Examples of my own runpod stuff / clientside code that i use to call the endpoint if you want examples
justin
justin9mo ago
If you do want to use stuff async, I have an example here: https://github.com/justinwlin/Runpod-OpenLLM-Pod-and-Serverless/blob/main/handler.py
GitHub
Runpod-OpenLLM-Pod-and-Serverless/handler.py at main · justinwlin/R...
A repo for OpenLLM to run pod. Contribute to justinwlin/Runpod-OpenLLM-Pod-and-Serverless development by creating an account on GitHub.
abtx
abtxOP9mo ago
Thank you so much! I reported the bug on GitHub: https://github.com/runpod/runpod-python/issues/304
GitHub
Async /run does not work when testing locally · Issue #304 · runp...
Describe the bug When I create a handler runpod.serverless.start({"handler": async_generator_handler}) Only http://localhost:8000/runsync triggers async_generator_handler However when pos...
flash-singh
flash-singh9mo ago
@Merrell
Want results from more Discord servers?
Add your server