[GH-ISSUE #208] Integration with Sanic framework #166

Open
opened 2026-10-26 21:13:19 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @synergiator on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/208

Is there a reason not to implement a prototype wrapper of the Janus with Sanic framework? A similar torch-based setup worked but here happens the following, without custom code on the nested level where the error comes from:

Main  2025-03-22 15:18:55 +0000 INFO: packages: sanic-routing==23.12.0, sanic-ext==24.12.0
Traceback (most recent call last):
  File "/service/modules/rest_api.py", line 258, in <module>
    app.run(host="0.0.0.0", port=5000)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 282, in run
    serve(primary=self)  # type: ignore
    ~~~~~^^^^^^^^^^^^^^
  File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 994, in serve
    cls._set_startup_method()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 928, in _set_startup_method
    raise RuntimeError(
    ...<3 lines>...
    ) from None
RuntimeError: Start method 'spawn' was requested, but 'fork' was already set.

Same issue reposted in Sanic repo: https://github.com/sanic-org/sanic/issues/3045

Originally created by @synergiator on GitHub (Mar 25, 2025). Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/208 Is there a reason not to implement a prototype wrapper of the Janus with Sanic framework? A similar torch-based setup worked but here happens the following, without custom code on the nested level where the error comes from: ``` Main 2025-03-22 15:18:55 +0000 INFO: packages: sanic-routing==23.12.0, sanic-ext==24.12.0 Traceback (most recent call last): File "/service/modules/rest_api.py", line 258, in <module> app.run(host="0.0.0.0", port=5000) ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 282, in run serve(primary=self) # type: ignore ~~~~~^^^^^^^^^^^^^^ File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 994, in serve cls._set_startup_method() ~~~~~~~~~~~~~~~~~~~~~~~^^ File "/service/venv/lib/python3.13/site-packages/sanic/mixins/startup.py", line 928, in _set_startup_method raise RuntimeError( ...<3 lines>... ) from None RuntimeError: Start method 'spawn' was requested, but 'fork' was already set. ``` Same issue reposted in Sanic repo: https://github.com/sanic-org/sanic/issues/3045
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/Janus#166
No description provided.