Skip to content

Commit

Permalink
Update ffigen, pub upgrade
Browse files Browse the repository at this point in the history
CI macOS/iOS started failing after Xcode 15.1. Downloaded it locally,
built and ran fine. Updated old packages. Builds and runs fine.
  • Loading branch information
jpohhhh committed Nov 1, 2024
1 parent 446510e commit 2106c72
Show file tree
Hide file tree
Showing 9 changed files with 1,343 additions and 593 deletions.
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
fonnx: 43ccf5b747f218b7cf389d84c5b841aada6cb70d
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
onnxruntime-c: f5350dc5e5c4a25d0b2887a7320b8589db84431a
onnxruntime-extensions-c: 05cabc77ae90a851127fb966e1b4159d5da42874
onnxruntime-objc: f801d5bd43ac14110136f707dccf0c851822b51e
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
record_darwin: 1f6619f2abac4d1ca91d3eeab038c980d76f1517
record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
git:
url: https://github.com/Telosnex/libmonet.git
ref: main
record: ^5.0.4
record: ^5.1.2
audioplayers: ^6.0.0
file_picker: ^8.1.2
collection: ^1.18.0
Expand Down
4 changes: 2 additions & 2 deletions lib/models/whisper/whisper_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ Future<String> _getTranscriptFfi(

final tensorTypeAndShape = calloc<Pointer<OrtTensorTypeAndShapeInfo>>();
objects.api.getTensorTypeAndShape(outputValues.value, tensorTypeAndShape);
final tensorElementType = calloc<Int32>();
final tensorElementType = calloc<UnsignedInt>();
objects.api
.getTensorElementType(tensorTypeAndShape.value, tensorElementType);
assert(tensorElementType.value ==
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING);
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING.value);

final stringLengthPtr = calloc<Size>();
objects.api
Expand Down
26 changes: 13 additions & 13 deletions lib/onnx/ort.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 1,
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT.value,
);
if (status.isError) {
final error = 'Code: ${getErrorCodeMessage(status)}\n'
Expand Down Expand Up @@ -93,7 +93,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 2,
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT.value,
);
if (status.isError) {
final error = 'Code: ${getErrorCodeMessage(status)}\n'
Expand Down Expand Up @@ -139,7 +139,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 2, // We now have two dimensions
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT.value,
);

if (status.isError) {
Expand Down Expand Up @@ -190,7 +190,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 3, // We now have three dimensions
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT.value,
);

if (status.isError) {
Expand Down Expand Up @@ -232,7 +232,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 2,
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64.value,
);
if (status.isError) {
final error = 'Code: ${getErrorCodeMessage(status)}\n'
Expand Down Expand Up @@ -268,7 +268,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 1,
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32.value,
);
if (status.isError) {
final error = 'Code: ${getErrorCodeMessage(status)}\n'
Expand Down Expand Up @@ -303,7 +303,7 @@ extension DartNativeFunctions on OrtApi {
inputShape: inputShape,
inputShapeLengthInBytes: 2,
onnxTensorElementDataType:
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8,
ONNXTensorElementDataType.ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8.value,
);
if (status.isError) {
final error = 'Code: ${getErrorCodeMessage(status)}\n'
Expand Down Expand Up @@ -412,8 +412,8 @@ extension DartNativeFunctions on OrtApi {
/// Must be freed with [releaseMemoryInfo].
Pointer<OrtStatus> createCpuMemoryInfo(
Pointer<Pointer<OrtMemoryInfo>> memoryInfo, {
int ortAllocator = OrtAllocatorType.OrtArenaAllocator,
int ortMemType = OrtMemType.OrtMemTypeDefault,
int ortAllocator = 3 /* OrtAllocatorType.OrtArenaAllocator */,
int ortMemType = 0 /* OrtMemType.OrtMemTypeDefault */,
}) {
final createCpuMemoryInfoFn = CreateCpuMemoryInfo.asFunction<
Pointer<OrtStatus> Function(
Expand All @@ -440,7 +440,7 @@ extension DartNativeFunctions on OrtApi {

Pointer<OrtStatus> createEnv(
Pointer<Pointer<OrtEnv>> env, {
int logLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_ERROR,
int logLevel = 3 /* OrtLoggingLevel.ORT_LOGGING_LEVEL_ERROR */,
String logId = '',
}) {
final createEnvFn = CreateEnv.asFunction<
Expand Down Expand Up @@ -587,11 +587,11 @@ extension DartNativeFunctions on OrtApi {

Pointer<OrtStatus> getTensorElementType(
Pointer<OrtTensorTypeAndShapeInfo> info,
Pointer<Int32> out,
Pointer<UnsignedInt> out,
) {
final getTensorElementTypeFn = GetTensorElementType.asFunction<
Pointer<OrtStatus> Function(
Pointer<OrtTensorTypeAndShapeInfo>, Pointer<Int32>)>();
OrtStatusPtr Function(
Pointer<OrtTensorTypeAndShapeInfo>, Pointer<UnsignedInt>)>();
final status = getTensorElementTypeFn(info, out);
if (status.isError) {
final error =
Expand Down
Loading

0 comments on commit 2106c72

Please sign in to comment.