fxn 0.0.33__tar.gz → 0.0.35__tar.gz

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.
Files changed (49) hide show
  1. {fxn-0.0.33 → fxn-0.0.35}/PKG-INFO +1 -1
  2. fxn-0.0.35/fxn/libs/macos/Function.dylib +0 -0
  3. fxn-0.0.35/fxn/libs/windows/Function.dll +0 -0
  4. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/prediction/fxnc.py +14 -3
  5. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/prediction/service.py +3 -2
  6. {fxn-0.0.33 → fxn-0.0.35}/fxn/version.py +1 -1
  7. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/PKG-INFO +1 -1
  8. fxn-0.0.33/fxn/libs/macos/Function.dylib +0 -0
  9. fxn-0.0.33/fxn/libs/windows/Function.dll +0 -0
  10. {fxn-0.0.33 → fxn-0.0.35}/LICENSE +0 -0
  11. {fxn-0.0.33 → fxn-0.0.35}/README.md +0 -0
  12. {fxn-0.0.33 → fxn-0.0.35}/fxn/__init__.py +0 -0
  13. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/__init__.py +0 -0
  14. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/auth.py +0 -0
  15. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/env.py +0 -0
  16. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/misc.py +0 -0
  17. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/predict.py +0 -0
  18. {fxn-0.0.33 → fxn-0.0.35}/fxn/cli/predictors.py +0 -0
  19. {fxn-0.0.33 → fxn-0.0.35}/fxn/function.py +0 -0
  20. {fxn-0.0.33 → fxn-0.0.35}/fxn/graph/__init__.py +0 -0
  21. {fxn-0.0.33 → fxn-0.0.35}/fxn/graph/client.py +0 -0
  22. {fxn-0.0.33 → fxn-0.0.35}/fxn/libs/__init__.py +0 -0
  23. {fxn-0.0.33 → fxn-0.0.35}/fxn/libs/linux/__init__.py +0 -0
  24. {fxn-0.0.33 → fxn-0.0.35}/fxn/libs/macos/__init__.py +0 -0
  25. {fxn-0.0.33 → fxn-0.0.35}/fxn/libs/windows/__init__.py +0 -0
  26. {fxn-0.0.33 → fxn-0.0.35}/fxn/magic.py +0 -0
  27. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/__init__.py +0 -0
  28. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/environment.py +0 -0
  29. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/prediction/__init__.py +0 -0
  30. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/predictor.py +0 -0
  31. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/storage.py +0 -0
  32. {fxn-0.0.33 → fxn-0.0.35}/fxn/services/user.py +0 -0
  33. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/__init__.py +0 -0
  34. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/dtype.py +0 -0
  35. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/environment.py +0 -0
  36. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/prediction.py +0 -0
  37. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/predictor.py +0 -0
  38. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/profile.py +0 -0
  39. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/storage.py +0 -0
  40. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/tag.py +0 -0
  41. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/user.py +0 -0
  42. {fxn-0.0.33 → fxn-0.0.35}/fxn/types/value.py +0 -0
  43. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/SOURCES.txt +0 -0
  44. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/dependency_links.txt +0 -0
  45. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/entry_points.txt +0 -0
  46. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/requires.txt +0 -0
  47. {fxn-0.0.33 → fxn-0.0.35}/fxn.egg-info/top_level.txt +0 -0
  48. {fxn-0.0.33 → fxn-0.0.35}/pyproject.toml +0 -0
  49. {fxn-0.0.33 → fxn-0.0.35}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fxn
3
- Version: 0.0.33
3
+ Version: 0.0.35
4
4
  Summary: Run on-device and cloud AI prediction functions in Python. Register at https://fxn.ai.
5
5
  Author-email: "NatML Inc." <hi@fxn.ai>
6
6
  License: Apache License
Binary file
Binary file
@@ -55,12 +55,14 @@ class FXNValue(Structure): pass
55
55
  class FXNValueMap(Structure): pass
56
56
  class FXNConfiguration(Structure): pass
57
57
  class FXNPrediction(Structure): pass
58
+ class FXNPredictionStream(Structure): pass
58
59
  class FXNPredictor(Structure): pass
59
60
 
60
61
  FXNValueRef = POINTER(FXNValue)
61
62
  FXNValueMapRef = POINTER(FXNValueMap)
62
63
  FXNConfigurationRef = POINTER(FXNConfiguration)
63
64
  FXNPredictionRef = POINTER(FXNPrediction)
65
+ FXNPredictionStreamRef = POINTER(FXNPredictionStream)
64
66
  FXNPredictorRef = POINTER(FXNPredictor)
65
67
 
66
68
  def load_fxnc (path: Path) -> CDLL:
@@ -171,15 +173,24 @@ def load_fxnc (path: Path) -> CDLL:
171
173
  # FXNPredictionGetLogLength
172
174
  fxnc.FXNPredictionGetLogLength.argtypes = [FXNPredictionRef, POINTER(c_int32)]
173
175
  fxnc.FXNPredictionGetLogLength.restype = FXNStatus
176
+ # FXNPredictionStreamRelease
177
+ fxnc.FXNPredictionStreamRelease.argtypes = [FXNPredictionStreamRef]
178
+ fxnc.FXNPredictionStreamRelease.restype = FXNStatus
179
+ # FXNPredictionStreamReadNext
180
+ fxnc.FXNPredictionStreamReadNext.argtypes = [FXNPredictionStreamRef, POINTER(FXNPredictionRef)]
181
+ fxnc.FXNPredictionStreamReadNext.restype = FXNStatus
174
182
  # FXNPredictorCreate
175
183
  fxnc.FXNPredictorCreate.argtypes = [FXNConfigurationRef, POINTER(FXNPredictorRef)]
176
184
  fxnc.FXNPredictorCreate.restype = FXNStatus
177
185
  # FXNPredictorRelease
178
186
  fxnc.FXNPredictorRelease.argtypes = [FXNPredictorRef]
179
187
  fxnc.FXNPredictorRelease.restype = FXNStatus
180
- # FXNPredictorPredict
181
- fxnc.FXNPredictorPredict.argtypes = [FXNPredictorRef, FXNValueMapRef, POINTER(FXNPredictionRef)]
182
- fxnc.FXNPredictorPredict.restype = FXNStatus
188
+ # FXNPredictorCreatePrediction
189
+ fxnc.FXNPredictorCreatePrediction.argtypes = [FXNPredictorRef, FXNValueMapRef, POINTER(FXNPredictionRef)]
190
+ fxnc.FXNPredictorCreatePrediction.restype = FXNStatus
191
+ # FXNPredictorStreamPrediction
192
+ fxnc.FXNPredictorStreamPrediction.argtypes = [FXNPredictionRef, FXNValueMapRef, POINTER(FXNPredictionStreamRef)]
193
+ fxnc.FXNPredictorStreamPrediction.restype = FXNStatus
183
194
  # FXNGetVersion
184
195
  fxnc.FXNGetVersion.argtypes = []
185
196
  fxnc.FXNGetVersion.restype = c_char_p
@@ -155,7 +155,8 @@ class PredictionService:
155
155
  prediction = self.__parse_prediction(prediction, raw_outputs=raw_outputs, return_binary_path=return_binary_path)
156
156
  # Check edge prediction
157
157
  if prediction.type != PredictorType.Edge or raw_outputs:
158
- return prediction
158
+ yield prediction
159
+ continue
159
160
  # Load edge predictor
160
161
  predictor = self.__load(prediction)
161
162
  self.__cache[tag] = predictor
@@ -370,7 +371,7 @@ class PredictionService:
370
371
  value = to_fxn_value(fxnc, value, copy=False)
371
372
  fxnc.FXNValueMapSetValue(input_map, name.encode(), value)
372
373
  # Predict
373
- status = fxnc.FXNPredictorPredict(predictor, input_map, byref(prediction))
374
+ status = fxnc.FXNPredictorCreatePrediction(predictor, input_map, byref(prediction))
374
375
  assert status.value == FXNStatus.OK, f"Failed to create {tag} prediction with status: {status.value}"
375
376
  # Marshal prediction
376
377
  id = create_string_buffer(256)
@@ -3,4 +3,4 @@
3
3
  # Copyright © 2024 NatML Inc. All Rights Reserved.
4
4
  #
5
5
 
6
- __version__ = "0.0.33"
6
+ __version__ = "0.0.35"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fxn
3
- Version: 0.0.33
3
+ Version: 0.0.35
4
4
  Summary: Run on-device and cloud AI prediction functions in Python. Register at https://fxn.ai.
5
5
  Author-email: "NatML Inc." <hi@fxn.ai>
6
6
  License: Apache License
Binary file
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes