fxn 0.0.49__py3-none-any.whl → 0.0.51__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.
fxn/beta/metadata.py CHANGED
@@ -30,8 +30,8 @@ class CoreMLInferenceMetadata (BaseModel):
30
30
  Metadata required to lower a PyTorch model for inference on iOS, macOS, and visionOS with CoreML.
31
31
  """
32
32
  kind: Literal["meta.inference.coreml"] = "meta.inference.coreml"
33
- model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.")
34
- model_args: list[object] = Field(description="Positional inputs to the model.")
33
+ model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.", exclude=True)
34
+ model_args: list[object] = Field(description="Positional inputs to the model.", exclude=True)
35
35
  model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
36
36
 
37
37
  class ONNXInferenceMetadata (BaseModel):
@@ -39,8 +39,8 @@ class ONNXInferenceMetadata (BaseModel):
39
39
  Metadata required to lower a PyTorch model for inference.
40
40
  """
41
41
  kind: Literal["meta.inference.onnx"] = "meta.inference.onnx"
42
- model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.")
43
- model_args: list[object] = Field(description="Positional inputs to the model.")
42
+ model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.", exclude=True)
43
+ model_args: list[object] = Field(description="Positional inputs to the model.", exclude=True)
44
44
  model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
45
45
 
46
46
  class ONNXRuntimeInferenceSessionMetadata (BaseModel):
@@ -48,8 +48,8 @@ class ONNXRuntimeInferenceSessionMetadata (BaseModel):
48
48
  Metadata required to lower an ONNXRuntime `InferenceSession` for inference.
49
49
  """
50
50
  kind: Literal["meta.inference.onnxruntime"] = "meta.inference.onnxruntime"
51
- session: Annotated[object, BeforeValidator(_validate_ort_inference_session)] = Field(description="ONNXRuntime inference session to apply metadata to.")
52
- model_path: Path = Field(description="ONNX model path. The model must exist at this path in the compiler sandbox.")
51
+ session: Annotated[object, BeforeValidator(_validate_ort_inference_session)] = Field(description="ONNXRuntime inference session to apply metadata to.", exclude=True)
52
+ model_path: Path = Field(description="ONNX model path. The model must exist at this path in the compiler sandbox.", exclude=True)
53
53
  model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
54
54
 
55
55
  class LiteRTInferenceMetadata (BaseModel):
@@ -57,8 +57,8 @@ class LiteRTInferenceMetadata (BaseModel):
57
57
  Metadata required to lower PyTorch model for inference with LiteRT (fka TensorFlow Lite).
58
58
  """
59
59
  kind: Literal["meta.inference.litert"] = "meta.inference.litert"
60
- model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.")
61
- model_args: list[object] = Field(description="Positional inputs to the model.")
60
+ model: Annotated[object, BeforeValidator(_validate_torch_module)] = Field(description="PyTorch module to apply metadata to.", exclude=True)
61
+ model_args: list[object] = Field(description="Positional inputs to the model.", exclude=True)
62
62
  model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
63
63
 
64
64
  class LlamaCppInferenceMetadata (BaseModel): # INCOMPLETE
@@ -66,5 +66,5 @@ class LlamaCppInferenceMetadata (BaseModel): # INCOMPLETE
66
66
  Metadata required to lower a GGUF model for LLM inference.
67
67
  """
68
68
  kind: Literal["meta.inference.gguf"] = "meta.inference.gguf"
69
- model_path: Path = Field(description="GGUF model path. The model must exist at this path in the compiler sandbox.")
69
+ model_path: Path = Field(description="GGUF model path. The model must exist at this path in the compiler sandbox.", exclude=True)
70
70
  model_config = ConfigDict(arbitrary_types_allowed=True, frozen=True)
fxn/compile.py CHANGED
@@ -12,7 +12,7 @@ from types import ModuleType
12
12
  from typing import Literal
13
13
 
14
14
  from .beta import (
15
- CoreMLInferenceMetadata, GGUFInferenceMetadata,
15
+ CoreMLInferenceMetadata, LiteRTInferenceMetadata, LlamaCppInferenceMetadata,
16
16
  ONNXInferenceMetadata, ONNXRuntimeInferenceSessionMetadata
17
17
  )
18
18
  from .sandbox import Sandbox
@@ -22,7 +22,8 @@ CompileTarget = Literal["android", "ios", "linux", "macos", "visionos", "wasm",
22
22
 
23
23
  CompileMetadata = (
24
24
  CoreMLInferenceMetadata |
25
- GGUFInferenceMetadata |
25
+ LiteRTInferenceMetadata |
26
+ LlamaCppInferenceMetadata |
26
27
  ONNXInferenceMetadata |
27
28
  ONNXRuntimeInferenceSessionMetadata
28
29
  )
@@ -35,6 +36,7 @@ class PredictorSpec (BaseModel):
35
36
  description: str = Field(description="Predictor description. MUST be less than 100 characters long.", min_length=4, max_length=100)
36
37
  sandbox: Sandbox = Field(description="Sandbox to compile the function.")
37
38
  targets: list[str] | None = Field(description="Targets to compile this predictor for. Pass `None` to compile for our default targets.")
39
+ metadata: list[object] = Field(default=[], description="Metadata to use while compiling the function.")
38
40
  access: AccessMode = Field(description="Predictor access.")
39
41
  card: str | None = Field(default=None, description="Predictor card (markdown).")
40
42
  media: str | None = Field(default=None, description="Predictor media URL.")
@@ -48,8 +50,8 @@ def compile (
48
50
  sandbox: Sandbox=None,
49
51
  trace_modules: list[ModuleType]=[],
50
52
  targets: list[CompileTarget]=None,
51
- access: AccessMode=AccessMode.Private,
52
53
  metadata: list[CompileMetadata]=[],
54
+ access: AccessMode=AccessMode.Private,
53
55
  card: str | Path=None,
54
56
  media: Path=None,
55
57
  license: str=None,
@@ -64,8 +66,8 @@ def compile (
64
66
  sandbox (Sandbox): Sandbox to compile the function.
65
67
  trace_modules (list): Modules to trace and compile.
66
68
  targets (list): Targets to compile this predictor for. Pass `None` to compile for our default targets.
67
- access (AccessMode): Predictor access.
68
69
  metadata (list): Metadata to use while compiling the function.
70
+ access (AccessMode): Predictor access.
69
71
  card (str | Path): Predictor card markdown string or path to card.
70
72
  media (Path): Predictor thumbnail image (jpeg or png) path.
71
73
  license (str): Predictor license URL. This is required for public predictors.
fxn/version.py CHANGED
@@ -3,4 +3,4 @@
3
3
  # Copyright © 2025 NatML Inc. All Rights Reserved.
4
4
  #
5
5
 
6
- __version__ = "0.0.49"
6
+ __version__ = "0.0.51"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fxn
3
- Version: 0.0.49
3
+ Version: 0.0.51
4
4
  Summary: Run prediction functions locally in Python. Register at https://fxn.ai.
5
5
  Author-email: "NatML Inc." <hi@fxn.ai>
6
6
  License: Apache License
@@ -1,13 +1,13 @@
1
1
  fxn/__init__.py,sha256=gnJK7iOmMVWFhluW9bOvTNxJbpT-GwzDJTMmjA_XxOE,284
2
2
  fxn/client.py,sha256=Deje8eiS1VOHX85tQnV34viv2CPVx2ljwHSbyVB5Z1o,3790
3
- fxn/compile.py,sha256=A9dxw6yv1eCd-zEYnqiyjDUZou8TkbEIA_yB9Tn4pXo,3894
3
+ fxn/compile.py,sha256=Iw6JyhpmL3dZEI7PkVb5IpTeq3YhdUNjxgYzU99kbK0,4073
4
4
  fxn/function.py,sha256=XeEuALkbVhkvwEBUfP0A2fu3tdimwHemoR17oomhzc8,1407
5
5
  fxn/logging.py,sha256=MsTSf0GZxrHNDwVAXDOh8_zRUg9hkeZ8DfhFUJs7D8A,7250
6
6
  fxn/sandbox.py,sha256=50yY2GDdkAFl-6pXTleaD1LXYM6-pJ3C1epKsr0xdrM,7313
7
- fxn/version.py,sha256=4-nxo2o-o3bKrTQ7kErleegYVcaFykrKVxiw83XkgRA,95
7
+ fxn/version.py,sha256=2zCxqyFmURc8C37OeDuXXS3OeTDER7TROCbHoE5sCLU,95
8
8
  fxn/beta/__init__.py,sha256=5V58p4doyZOvmAETCxrGUu4hG04tNq8ejlfSxnEYHxE,281
9
9
  fxn/beta/client.py,sha256=0lfwQPcB9ToIJC7AcCXO6DlJKkmId8EChhd9bk29GGE,2611
10
- fxn/beta/metadata.py,sha256=gIG9QSgcDG6bpMefFc2KvnLfGkiRtpA7w-zM4TkzFZA,3587
10
+ fxn/beta/metadata.py,sha256=1Jo7jjMkhdBaIw5IyiDJ32kukJbym-el3T328GBanW8,3713
11
11
  fxn/beta/prediction.py,sha256=9DTBahNF6m0TicLab2o9e8IKpiSV6K7cUSTYaFju0ZU,356
12
12
  fxn/beta/remote.py,sha256=psPNcGFQKMGHAJG4NRDIQ2trStvTj2NOZeQqVI-e29Q,7529
13
13
  fxn/c/__init__.py,sha256=NMIduqO_MYtI9jVCu6ZxvbBtYQXoQyNEWblNy3m2UPY,313
@@ -41,9 +41,9 @@ fxn/types/dtype.py,sha256=71Tuu4IydmELcBcSBbmWswhCE-7WqBSQ4VkETsFRzjA,617
41
41
  fxn/types/prediction.py,sha256=BdLTxnKiSFbz5warX8g_Z4DedNxXK3gaNjSKR2FP8tA,2051
42
42
  fxn/types/predictor.py,sha256=KRGZEuDt7WPMCyRcZvQq4y2FMocfVrLEUNJCJgfDY9Y,4000
43
43
  fxn/types/user.py,sha256=Z44TwEocyxSrfKyzcNfmAXUrpX_Ry8fJ7MffSxRn4oU,1071
44
- fxn-0.0.49.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
45
- fxn-0.0.49.dist-info/METADATA,sha256=yESD1SJfu6MsEu1GMrwDAWrjJ1P3gvvvuu9nYYMP7AM,16136
46
- fxn-0.0.49.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
47
- fxn-0.0.49.dist-info/entry_points.txt,sha256=O_AwD5dYaeB-YT1F9hPAPuDYCkw_W0tdNGYbc5RVR2k,45
48
- fxn-0.0.49.dist-info/top_level.txt,sha256=1ULIEGrnMlhId8nYAkjmRn9g3KEFuHKboq193SEKQkA,4
49
- fxn-0.0.49.dist-info/RECORD,,
44
+ fxn-0.0.51.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
45
+ fxn-0.0.51.dist-info/METADATA,sha256=VyONkRDW3tvdHDnCPVmglWp0G7hKI1iaMLxDfm1enU4,16136
46
+ fxn-0.0.51.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
47
+ fxn-0.0.51.dist-info/entry_points.txt,sha256=O_AwD5dYaeB-YT1F9hPAPuDYCkw_W0tdNGYbc5RVR2k,45
48
+ fxn-0.0.51.dist-info/top_level.txt,sha256=1ULIEGrnMlhId8nYAkjmRn9g3KEFuHKboq193SEKQkA,4
49
+ fxn-0.0.51.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5