Skip to content
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

PyOxidizer Hangs when Handling Text Encoding (SentenceTransformers) #728

Open
bm777 opened this issue Dec 2, 2023 · 8 comments
Open

PyOxidizer Hangs when Handling Text Encoding (SentenceTransformers) #728

bm777 opened this issue Dec 2, 2023 · 8 comments

Comments

@bm777
Copy link

bm777 commented Dec 2, 2023

Issue Summary

@indygreg
I am experiencing difficulties with PyOxidizer while generating an executable for my Python project. Specifically, the process seems to get stuck during text encoding, and I suspect it may be related to the loading of "file". (I wrote a python script to verify every file in the sentence-transformers libraries, it doesn't contains file string) Because all libraries like numpy, huggingface-cli work well in the bundle.

Steps to Reproduce

  • installed rustup and pyoxidizer
  • Create a pyoxidizer project and add some Numpy, SentenceTransformers, other libraries
  • make_exe content:
def make_exe():
   dist = default_python_distribution()

   dependencies = ["-r", "requirements.txt"]

   policy = dist.make_python_packaging_policy()
   policy.resources_location_fallback = "filesystem-relative:lib"
   python_config = dist.make_python_interpreter_config()
   python_config.config_profile = "python"
   python_config.run_module = "main"
   

   exe = dist.to_python_executable(
       name="oxid",
       packaging_policy=policy,
       config=python_config,
   )

   for resource in exe.pip_install(dependencies):
       resource.add_location = "filesystem-relative:lib"
       exe.add_python_resource(resource)

   exe.add_python_resources(exe.read_package_root(
       path="/path/to/the/app",
       packages=["main", "app"],
   ))

   return exe

Expected Behavior

I want the app to encode the text using the sentenceTransformers lib, that I successfully loaded in the lib close to the exec.

Actual Behavior

When it comes to encode the text, it stuck it do nothing. I detected that by ainserting a simple print before and after the line. And it never reach the after-print.

Environment Information

  • PyOxidizer version: 0.24.0
  • Python version: 3.10
  • Operating System: MacBook pro - OS X 14 and M2 chip
@bm777
Copy link
Author

bm777 commented Dec 4, 2023

Issue solved. closing to not make it stale.

@bm777 bm777 closed this as completed Dec 4, 2023
@saraswatpuneet
Copy link

@bm777 how was your issue resolved, trying something similar but not success so far

@bm777
Copy link
Author

bm777 commented Apr 27, 2024

Are you also using library like PyTorch or numpy and pandas?

@saraswatpuneet
Copy link

saraswatpuneet commented Apr 27, 2024

Yes I am using torch, so guessing it's related,

Thank you for quick response though

@bm777
Copy link
Author

bm777 commented Apr 27, 2024

can you share pyoxidezer config file? it will be easy for me to point out what is missing or wrong.
(without the comments part :) )

@bm777 bm777 reopened this Apr 27, 2024
@saraswatpuneet
Copy link

Here my config file as well dependencies, I am able to build without torch

pyoxidizer.bzl.txt
requirements.txt

@bm777
Copy link
Author

bm777 commented Apr 27, 2024

would you wait for this weekend, because i'm about to write a hello-world and how to add libraries like torch.
I will post it there #738 and also here.

@saraswatpuneet
Copy link

Most definitely, thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants