fal-ai / fal

⚡ Fastest way to serve open source ML models to millions
https://fal.ai/docs
Apache License 2.0
201 stars 18 forks source link

fal: support automatically pickling namespace packages by value #222

Closed efiop closed 4 weeks ago

efiop commented 1 month ago

We have this very unfortunate situation in multiple places, where you have a namespace package (meaning one that doesn't have __init__.py) with some python files and whether or not fal run will work depends on what your file is doing at import time.

We rely on searching for __init__.py to detect a python package in our serialization logic, but should also take namespace packages into account, which means doing some trickier stuff.

We could use importlib/inspect magic (similar to modal) instead of runpy, this should probably make this easier.

linear[bot] commented 1 month ago

FEA-2566 fal: support pickling namespace packages by value