News for hackers. Stuff that matters.
Re:Running GitHub on Rails 6.0 by phodo on Monday September 09, 2019 @03:59PM (#20921817)
How does one connect a rails 6 app to a python tensor flow (inference) model?
Re:Running GitHub on Rails 6.0 by ssaunier_ on Tuesday September 10, 2019 @02:31AM (#20925601)
As suggested, encapsulate your prediction model in a web service, then calling it from Rails would be a good way to go.

An other way is to use something like Faktory (https://contribsys.com/faktory/) on top of Redis. You push jobs from Rails and then you pull them from Python to execute. Then Python can enqueue another job with the result which gets consumed by Rails (async callback).

Re:Running GitHub on Rails 6.0 by aledalgrande on Monday September 09, 2019 @05:24PM (#20922619)
Using a client to connect to a prediction HTTP service would be my choice (Flask app?). Otherwise if you want to you can do something with the backticks, which will run a shell process from Ruby and get the return value: `python3 predict.py <input>`
Re:Running GitHub on Rails 6.0 by GolDDranks on Tuesday September 10, 2019 @03:00AM (#20925729)
You deploy the Python model to a backend service and expose a simple HTTP-based API, maybe using Flask? You should preferably keep the web part and heavy lifting separate.
Re:Running GitHub on Rails 6.0 by nurettin on Tuesday September 10, 2019 @12:59AM (#20925152)
Like you connect anything to anything else. You use a myriad of Inter-process communication techniques from memory maps to named pipes to socket protocols to databases.