-
-
Notifications
You must be signed in to change notification settings - Fork 34
feat: setup media matching [WIP] #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/media-processing
Are you sure you want to change the base?
feat: setup media matching [WIP] #784
Conversation
@python_path Path.expand("lib/python") | ||
|
||
def get_embedding(file_path) do | ||
{:ok, py} = Python.start(python_path: @python_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be something you do in an init function.
my sense is that you can create a port that talks to the python process and keep it open. This py has to be a reference to that port. so best to create it once and then use throughout the functions that talk to the port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do I do that in elixir? sorry I am bit confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am proposing creating a new function init_worker
def init_worker() do
{:ok, py} = Python.start(python_path: @python_path)
py
end
and then the calling code can pass py
to other functions in this module that might need it. for example Python.call(py ...)
resolves #750