I’m looking to create some games on a website using Django. I would like to have some machine learning with the games so that the players can play against a machine learning model. Is this possible with the combination of Django and PyTorch? I heard about something called ONNX that helps serves model into the frontend and I just wanted to double check that works with Django and not exclusively with NodeJS. If it doesn’t work then I’d appreciate any alternative solutions.
You would need to first identify the type of integration that you’re looking to use to connect the two frameworks.
I don’t know anything about PyTorch, but I’m guessing that you might want to run that as a separate process from your Django instance, and use something as an IPC mechanism to connect the two.
(What you absolutely do not want to do is to try and run an external process from within your Django instance.)
I do something analogous to what you’re looking to do here in my “game engine”. See the thread at Running multiplayer game loop with django channels for a description of how I integrate that engine with Django & Channels.