fal 1.29.1__py3-none-any.whl → 1.30.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fal/_fal_version.py +16 -3
- fal/app.py +3 -1
- fal/cli/deploy.py +6 -1
- fal/sdk.py +23 -0
- fal/toolkit/utils/__init__.py +1 -0
- fal/toolkit/utils/setup_utils.py +34 -0
- {fal-1.29.1.dist-info → fal-1.30.1.dist-info}/METADATA +3 -3
- {fal-1.29.1.dist-info → fal-1.30.1.dist-info}/RECORD +11 -10
- {fal-1.29.1.dist-info → fal-1.30.1.dist-info}/WHEEL +0 -0
- {fal-1.29.1.dist-info → fal-1.30.1.dist-info}/entry_points.txt +0 -0
- {fal-1.29.1.dist-info → fal-1.30.1.dist-info}/top_level.txt +0 -0
fal/_fal_version.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '1.
|
|
21
|
-
__version_tuple__ = version_tuple = (1,
|
|
31
|
+
__version__ = version = '1.30.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 30, 1)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
fal/app.py
CHANGED
|
@@ -337,8 +337,10 @@ class App(BaseServable):
|
|
|
337
337
|
|
|
338
338
|
def __init__(self, *, _allow_init: bool = False):
|
|
339
339
|
if not _allow_init and not os.getenv("IS_ISOLATE_AGENT"):
|
|
340
|
+
cls_name = self.__class__.__name__
|
|
340
341
|
raise NotImplementedError(
|
|
341
|
-
"Running apps through SDK is not implemented yet."
|
|
342
|
+
"Running apps through SDK is not implemented yet. "
|
|
343
|
+
f"Please use `fal run path/to/app.py::{cls_name}` to run your app."
|
|
342
344
|
)
|
|
343
345
|
|
|
344
346
|
@classmethod
|
fal/cli/deploy.py
CHANGED
|
@@ -142,11 +142,16 @@ def _deploy_from_reference(
|
|
|
142
142
|
args.console.print(
|
|
143
143
|
f"\thttps://{playground_host}/models/{user.username}/{app_name}{endpoint}"
|
|
144
144
|
)
|
|
145
|
-
args.console.print("Endpoints:")
|
|
145
|
+
args.console.print("Synchronous Endpoints:")
|
|
146
146
|
for endpoint in loaded.endpoints:
|
|
147
147
|
args.console.print(
|
|
148
148
|
f"\thttps://{endpoint_host}/{user.username}/{app_name}{endpoint}"
|
|
149
149
|
)
|
|
150
|
+
args.console.print("Asynchronous Endpoints (Recommended):")
|
|
151
|
+
for endpoint in loaded.endpoints:
|
|
152
|
+
args.console.print(
|
|
153
|
+
f"\thttps://queue.{endpoint_host}/{user.username}/{app_name}{endpoint}"
|
|
154
|
+
)
|
|
150
155
|
|
|
151
156
|
|
|
152
157
|
def _deploy(args):
|
fal/sdk.py
CHANGED
|
@@ -288,6 +288,14 @@ class RunnerInfo:
|
|
|
288
288
|
state: RunnerState
|
|
289
289
|
|
|
290
290
|
|
|
291
|
+
@dataclass
|
|
292
|
+
class ServiceURLs:
|
|
293
|
+
playground: str
|
|
294
|
+
run: str
|
|
295
|
+
queue: str
|
|
296
|
+
ws: str
|
|
297
|
+
|
|
298
|
+
|
|
291
299
|
@dataclass
|
|
292
300
|
class HostedRunResult(Generic[ResultT]):
|
|
293
301
|
run_id: str
|
|
@@ -295,12 +303,14 @@ class HostedRunResult(Generic[ResultT]):
|
|
|
295
303
|
logs: list[Log] = field(default_factory=list)
|
|
296
304
|
result: ResultT | None = None
|
|
297
305
|
stream: Any = None
|
|
306
|
+
service_urls: ServiceURLs | None = None
|
|
298
307
|
|
|
299
308
|
|
|
300
309
|
@dataclass
|
|
301
310
|
class RegisterApplicationResult:
|
|
302
311
|
result: RegisterApplicationResultType | None
|
|
303
312
|
logs: list[Log] = field(default_factory=list)
|
|
313
|
+
service_urls: ServiceURLs | None = None
|
|
304
314
|
|
|
305
315
|
|
|
306
316
|
@dataclass
|
|
@@ -452,6 +462,9 @@ def _from_grpc_register_application_result(
|
|
|
452
462
|
if not message.HasField("result")
|
|
453
463
|
else RegisterApplicationResultType(message.result.application_id)
|
|
454
464
|
),
|
|
465
|
+
service_urls=from_grpc(message.service_urls)
|
|
466
|
+
if message.HasField("service_urls")
|
|
467
|
+
else None,
|
|
455
468
|
)
|
|
456
469
|
|
|
457
470
|
|
|
@@ -462,6 +475,13 @@ def _from_grpc_hosted_run_status(
|
|
|
462
475
|
return HostedRunStatus(HostedRunState(message.state))
|
|
463
476
|
|
|
464
477
|
|
|
478
|
+
@from_grpc.register(isolate_proto.ServiceURLs)
|
|
479
|
+
def _from_grpc_service_urls(
|
|
480
|
+
message: isolate_proto.ServiceURLs,
|
|
481
|
+
) -> ServiceURLs:
|
|
482
|
+
return ServiceURLs(message.playground, message.run, message.queue, message.ws)
|
|
483
|
+
|
|
484
|
+
|
|
465
485
|
@from_grpc.register(isolate_proto.HostedRunResult)
|
|
466
486
|
def _from_grpc_hosted_run_result(
|
|
467
487
|
message: isolate_proto.HostedRunResult,
|
|
@@ -476,6 +496,9 @@ def _from_grpc_hosted_run_result(
|
|
|
476
496
|
from_grpc(message.status),
|
|
477
497
|
logs=[from_grpc(log) for log in message.logs],
|
|
478
498
|
result=return_value,
|
|
499
|
+
service_urls=from_grpc(message.service_urls)
|
|
500
|
+
if message.HasField("service_urls")
|
|
501
|
+
else None,
|
|
479
502
|
)
|
|
480
503
|
|
|
481
504
|
|
fal/toolkit/utils/__init__.py
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def patch_onnx_runtime(
|
|
5
|
+
inter_op_num_threads: int = 16,
|
|
6
|
+
intra_op_num_threads: int = 16,
|
|
7
|
+
omp_num_threads: int = 16,
|
|
8
|
+
):
|
|
9
|
+
"""
|
|
10
|
+
Patch ONNX Runtime's defaults to set the number of threads for inter-op,
|
|
11
|
+
intra-op, and OpenMP.Trying to use an ONNX Runtime session within a fal app
|
|
12
|
+
without explicitly setting these parameters can lead to issues, for example,
|
|
13
|
+
it can cause several logs related to these parameters to be printed.
|
|
14
|
+
Please run this function before importing any ONNX Runtime modules
|
|
15
|
+
in your application.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
inter_op_num_threads (int): Number of threads for inter-op parallelism.
|
|
19
|
+
intra_op_num_threads (int): Number of threads for intra-op parallelism.
|
|
20
|
+
omp_num_threads (int): Number of threads for OpenMP parallelism.
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
import onnxruntime as ort
|
|
24
|
+
|
|
25
|
+
os.environ["OMP_NUM_THREADS"] = str(omp_num_threads)
|
|
26
|
+
|
|
27
|
+
_default_session_options = ort.capi._pybind_state.get_default_session_options()
|
|
28
|
+
|
|
29
|
+
def get_default_session_options_new():
|
|
30
|
+
_default_session_options.inter_op_num_threads = inter_op_num_threads
|
|
31
|
+
_default_session_options.intra_op_num_threads = intra_op_num_threads
|
|
32
|
+
return _default_session_options
|
|
33
|
+
|
|
34
|
+
ort.capi._pybind_state.get_default_session_options = get_default_session_options_new
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fal
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.30.1
|
|
4
4
|
Summary: fal is an easy-to-use Serverless Python Framework
|
|
5
5
|
Author: Features & Labels <support@fal.ai>
|
|
6
6
|
Requires-Python: >=3.8
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: isolate[build]<0.19.0,>=0.18.0
|
|
9
|
-
Requires-Dist: isolate-proto<0.
|
|
9
|
+
Requires-Dist: isolate-proto<0.13.0,>=0.12.0
|
|
10
10
|
Requires-Dist: grpcio<2,>=1.64.0
|
|
11
11
|
Requires-Dist: dill==0.3.7
|
|
12
12
|
Requires-Dist: cloudpickle==3.0.0
|
|
@@ -31,7 +31,7 @@ Requires-Dist: python-dateutil<3,>=2.8.0
|
|
|
31
31
|
Requires-Dist: types-python-dateutil<3,>=2.8.0
|
|
32
32
|
Requires-Dist: importlib-metadata>=4.4; python_version < "3.10"
|
|
33
33
|
Requires-Dist: msgpack<2,>=1.0.7
|
|
34
|
-
Requires-Dist: websockets
|
|
34
|
+
Requires-Dist: websockets>=12.0
|
|
35
35
|
Requires-Dist: pillow<11,>=10.2.0
|
|
36
36
|
Requires-Dist: pyjwt[crypto]<3,>=2.8.0
|
|
37
37
|
Requires-Dist: uvicorn<1,>=0.29.0
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
fal/__init__.py,sha256=wXs1G0gSc7ZK60-bHe-B2m0l_sA6TrFk4BxY0tMoLe8,784
|
|
2
2
|
fal/__main__.py,sha256=4JMK66Wj4uLZTKbF-sT3LAxOsr6buig77PmOkJCRRxw,83
|
|
3
|
-
fal/_fal_version.py,sha256=
|
|
3
|
+
fal/_fal_version.py,sha256=mJIDJJ8D9hB2yNKuePFRRCkCI-ZopC_n3RkcRtJv-tg,706
|
|
4
4
|
fal/_serialization.py,sha256=npXNsFJ5G7jzBeBIyVMH01Ww34mGY4XWhHpRbSrTtnQ,7598
|
|
5
5
|
fal/_version.py,sha256=1BbTFnucNC_6ldKJ_ZoC722_UkW4S9aDBSW9L0fkKAw,2315
|
|
6
6
|
fal/api.py,sha256=TWUpQICgsRO5aDdRP8A3sFI26P6QM93TobcW9M4E0lQ,47501
|
|
7
|
-
fal/app.py,sha256=
|
|
7
|
+
fal/app.py,sha256=2zCrpSgqWY8kIuxu2RIOeoKC1_dbC3s7Im2qokUq0js,25872
|
|
8
8
|
fal/apps.py,sha256=pzCd2mrKl5J_4oVc40_pggvPtFahXBCdrZXWpnaEJVs,12130
|
|
9
9
|
fal/config.py,sha256=1HRaOJFOAjB7fbQoEPCSH85gMvEEMIMPeupVWgrHVgU,3572
|
|
10
10
|
fal/container.py,sha256=FTsa5hOW4ars-yV1lUoc0BNeIIvAZcpw7Ftyt3A4m_w,2000
|
|
@@ -13,7 +13,7 @@ fal/flags.py,sha256=QonyDM7R2GqfAB1bJr46oriu-fHJCkpUwXuSdanePWg,987
|
|
|
13
13
|
fal/project.py,sha256=QgfYfMKmNobMPufrAP_ga1FKcIAlSbw18Iar1-0qepo,2650
|
|
14
14
|
fal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
fal/rest_client.py,sha256=kGBGmuyHfX1lR910EoKCYPjsyU8MdXawT_cW2q8Sajc,568
|
|
16
|
-
fal/sdk.py,sha256=
|
|
16
|
+
fal/sdk.py,sha256=TdDj86WFWiK1g4g6MdxiA6vbMVc9ix8Iges2UtBGt4g,27406
|
|
17
17
|
fal/sync.py,sha256=ZuIJA2-hTPNANG9B_NNJZUsO68EIdTH0dc9MzeVE2VU,4340
|
|
18
18
|
fal/utils.py,sha256=iQTBG3-i6JZgHkkwbY_I4210g0xoW-as51yrke608u0,2208
|
|
19
19
|
fal/workflows.py,sha256=Zl4f6Bs085hY40zmqScxDUyCu7zXkukDbW02iYOLTTI,14805
|
|
@@ -28,7 +28,7 @@ fal/cli/auth.py,sha256=Qe-Z3ycXJnOzHimz5PjCQYoni8MF4csmdL19yGN7a1o,5171
|
|
|
28
28
|
fal/cli/cli_nested_json.py,sha256=veSZU8_bYV3Iu1PAoxt-4BMBraNIqgH5nughbs2UKvE,13539
|
|
29
29
|
fal/cli/create.py,sha256=a8WDq-nJLFTeoIXqpb5cr7GR7YR9ZZrQCawNm34KXXE,627
|
|
30
30
|
fal/cli/debug.py,sha256=u_urnyFzSlNnrq93zz_GXE9FX4VyVxDoamJJyrZpFI0,1312
|
|
31
|
-
fal/cli/deploy.py,sha256=
|
|
31
|
+
fal/cli/deploy.py,sha256=JAUi9FtN58pGk3_2JPd84h-RKurLatRjAUxL_Oe0vWo,8701
|
|
32
32
|
fal/cli/doctor.py,sha256=U4ne9LX5gQwNblsYQ27XdO8AYDgbYjTO39EtxhwexRM,983
|
|
33
33
|
fal/cli/files.py,sha256=pSgAnTm2eHdP-IPkMIVfnK_Ii7mkSSOVgvbsiFUVBC0,2936
|
|
34
34
|
fal/cli/keys.py,sha256=7Sf4DT4le89G42eAOt0ltRjbZAtE70AVQ62hmjZhUy0,3059
|
|
@@ -73,10 +73,11 @@ fal/toolkit/image/nsfw_filter/env.py,sha256=iAP2Q3vzIl--DD8nr8o3o0goAwhExN2v0feY
|
|
|
73
73
|
fal/toolkit/image/nsfw_filter/inference.py,sha256=BhIPF_zxRLetThQYxDDF0sdx9VRwvu74M5ye6Povi40,2167
|
|
74
74
|
fal/toolkit/image/nsfw_filter/model.py,sha256=63mu8D15z_IosoRUagRLGHy6VbLqFmrG-yZqnu2vVm4,457
|
|
75
75
|
fal/toolkit/image/nsfw_filter/requirements.txt,sha256=3Pmrd0Ny6QAeBqUNHCgffRyfaCARAPJcfSCX5cRYpbM,37
|
|
76
|
-
fal/toolkit/utils/__init__.py,sha256=
|
|
76
|
+
fal/toolkit/utils/__init__.py,sha256=w3Q-9So2HUefk7pU3wMGxhAx2PRsab4mBOxI9JlMmsQ,172
|
|
77
77
|
fal/toolkit/utils/download_utils.py,sha256=F6oRoP2ynO5xgeRtweVpgJ5xmEhpbKorkXDrakaPpTw,21391
|
|
78
78
|
fal/toolkit/utils/endpoint.py,sha256=5EXoshA2PD_brjEfhNWAWasjqLOCRrjBnfhj6QGuMt8,782
|
|
79
79
|
fal/toolkit/utils/retry.py,sha256=0pnKqs1Y2dADMAk2944FZr68ZL3wQC_5hqApfgyMf_8,1531
|
|
80
|
+
fal/toolkit/utils/setup_utils.py,sha256=PuFkswFMUCVgfMawGuhCj4lHS7wX-yXXmAhX7hu-Ijo,1311
|
|
80
81
|
fal/toolkit/video/__init__.py,sha256=YV0jWpuvoA_CDFQXhd3zOvilFLKH7DYARrbzR7hWhpE,35
|
|
81
82
|
fal/toolkit/video/video.py,sha256=dHNMdV_zJHiJMzlfIiyDv7tqJBsD32aoc3Ao0t1nKNk,572
|
|
82
83
|
openapi_fal_rest/__init__.py,sha256=ziculmF_i6trw63LzZGFX-6W3Lwq9mCR8_UpkpvpaHI,152
|
|
@@ -142,8 +143,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
|
|
|
142
143
|
openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
|
|
143
144
|
openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
|
|
144
145
|
openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
|
|
145
|
-
fal-1.
|
|
146
|
-
fal-1.
|
|
147
|
-
fal-1.
|
|
148
|
-
fal-1.
|
|
149
|
-
fal-1.
|
|
146
|
+
fal-1.30.1.dist-info/METADATA,sha256=-NOpC6mIUsPkeGzMYr6EqKXfVMktBFOj5ih4ko8rs-0,4085
|
|
147
|
+
fal-1.30.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
148
|
+
fal-1.30.1.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
|
|
149
|
+
fal-1.30.1.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
|
|
150
|
+
fal-1.30.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|