Skip to content

Update iOS LLM Application #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added mobile/examples/phi-3/ios/LocalLLM/IMG_1014.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objectVersion = 70;
objects = {

/* Begin PBXBuildFile section */
5156483D2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5156483C2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib */; };
5156483E2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 5156483C2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
51D4C8D62BFD22D70029FCEA /* LocalLLMApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51D4C8D52BFD22D70029FCEA /* LocalLLMApp.swift */; };
51D4C8D82BFD22D70029FCEA /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51D4C8D72BFD22D70029FCEA /* ContentView.swift */; };
51D4C8DA2BFD22DB0029FCEA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 51D4C8D92BFD22DB0029FCEA /* Assets.xcassets */; };
51D4C8DD2BFD22DB0029FCEA /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 51D4C8DC2BFD22DB0029FCEA /* Preview Assets.xcassets */; };
51D4C9072BFD26150029FCEA /* libonnxruntime-genai.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51D4C9052BFD26150029FCEA /* libonnxruntime-genai.dylib */; };
51D4C9082BFD26EB0029FCEA /* libonnxruntime-genai.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 51D4C9052BFD26150029FCEA /* libonnxruntime-genai.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
51D4C90E2BFD28DD0029FCEA /* GenAIGenerator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D4C90D2BFD28DD0029FCEA /* GenAIGenerator.mm */; };
51D4C9232BFD507A0029FCEA /* SharedTokenUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51D4C9222BFD50790029FCEA /* SharedTokenUpdater.swift */; };
8A4D13D82CE2B1AE002BD11A /* libonnxruntime-genai.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51D4C9052BFD26150029FCEA /* libonnxruntime-genai.dylib */; };
8A4D13DF2CE2B1BA002BD11A /* libonnxruntime-genai.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 51D4C9052BFD26150029FCEA /* libonnxruntime-genai.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8A53DB0C2DAF08B3001D41D1 /* onnxruntime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A53DB0B2DAF08B3001D41D1 /* onnxruntime.framework */; };
8A53DB0D2DAF08D0001D41D1 /* onnxruntime.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 8A53DB0B2DAF08B3001D41D1 /* onnxruntime.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -26,8 +26,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
5156483E2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib in Embed Libraries */,
51D4C9082BFD26EB0029FCEA /* libonnxruntime-genai.dylib in Embed Libraries */,
8A53DB0D2DAF08D0001D41D1 /* onnxruntime.framework in Embed Libraries */,
8A4D13DF2CE2B1BA002BD11A /* libonnxruntime-genai.dylib in Embed Libraries */,
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -44,7 +44,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
5156483C2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libonnxruntime.1.19.0.dylib; path = LocalLLM/lib/libonnxruntime.1.19.0.dylib; sourceTree = "<group>"; };
51D4C8D22BFD22D70029FCEA /* LocalLLM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LocalLLM.app; sourceTree = BUILT_PRODUCTS_DIR; };
51D4C8D52BFD22D70029FCEA /* LocalLLMApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalLLMApp.swift; sourceTree = "<group>"; };
51D4C8D72BFD22D70029FCEA /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand All @@ -57,25 +56,38 @@
51D4C90B2BFD28BF0029FCEA /* GenAIGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GenAIGenerator.h; sourceTree = "<group>"; };
51D4C90C2BFD28DD0029FCEA /* LocalLLM-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LocalLLM-Bridging-Header.h"; sourceTree = "<group>"; };
51D4C90D2BFD28DD0029FCEA /* GenAIGenerator.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GenAIGenerator.mm; sourceTree = "<group>"; };
51D4C9102BFD483E0029FCEA /* tokenizer.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = tokenizer.json; path = ../GenAIApp/tokenizer.json; sourceTree = "<group>"; };
51D4C9112BFD483E0029FCEA /* phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; name = "phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx"; path = "../GenAIApp/phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx"; sourceTree = "<group>"; };
51D4C9122BFD483E0029FCEA /* special_tokens_map.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = special_tokens_map.json; path = ../GenAIApp/special_tokens_map.json; sourceTree = "<group>"; };
51D4C9132BFD483E0029FCEA /* phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data */ = {isa = PBXFileReference; lastKnownFileType = file; name = "phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data"; path = "../GenAIApp/phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data"; sourceTree = "<group>"; };
51D4C9142BFD483E0029FCEA /* tokenizer_config.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = tokenizer_config.json; path = ../GenAIApp/tokenizer_config.json; sourceTree = "<group>"; };
51D4C91A2BFD48490029FCEA /* config.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = config.json; path = ../GenAIApp/config.json; sourceTree = "<group>"; };
51D4C91B2BFD48490029FCEA /* added_tokens.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = added_tokens.json; path = ../GenAIApp/added_tokens.json; sourceTree = "<group>"; };
51D4C91C2BFD48490029FCEA /* configuration_phi3.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = configuration_phi3.py; path = ../GenAIApp/configuration_phi3.py; sourceTree = "<group>"; };
51D4C91D2BFD48490029FCEA /* genai_config.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = genai_config.json; path = ../GenAIApp/genai_config.json; sourceTree = "<group>"; };
51D4C9222BFD50790029FCEA /* SharedTokenUpdater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedTokenUpdater.swift; sourceTree = "<group>"; };
8A53DB0B2DAF08B3001D41D1 /* onnxruntime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = onnxruntime.framework; sourceTree = "<group>"; };
8A869B212CDAD08600AE0604 /* LocalLLM.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LocalLLM.entitlements; sourceTree = "<group>"; };
8ABA12972CC1D15C006B3DDF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
8AC409CD2DADE0EC00388525 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/genai_config.json",
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/model.onnx",
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/model.onnx.data",
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/special_tokens_map.json",
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/tokenizer_config.json",
"LLama-3.2-1B-int4-acc_4-gqa-webgpu-fp16/tokenizer.json",
);
target = 51D4C8D12BFD22D70029FCEA /* LocalLLM */;
};
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
8ABA12A22CC300ED006B3DDF /* model */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (8AC409CD2DADE0EC00388525 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = model; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
51D4C8CF2BFD22D70029FCEA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5156483D2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib in Frameworks */,
51D4C9072BFD26150029FCEA /* libonnxruntime-genai.dylib in Frameworks */,
8A53DB0C2DAF08B3001D41D1 /* onnxruntime.framework in Frameworks */,
8A4D13D82CE2B1AE002BD11A /* libonnxruntime-genai.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -85,23 +97,14 @@
5156483B2BFDBB6E005CA50C /* Frameworks */ = {
isa = PBXGroup;
children = (
5156483C2BFDBB6F005CA50C /* libonnxruntime.1.19.0.dylib */,
);
name = Frameworks;
sourceTree = "<group>";
};
51D4C8C92BFD22D70029FCEA = {
isa = PBXGroup;
children = (
51D4C91B2BFD48490029FCEA /* added_tokens.json */,
51D4C91A2BFD48490029FCEA /* config.json */,
51D4C91C2BFD48490029FCEA /* configuration_phi3.py */,
51D4C91D2BFD48490029FCEA /* genai_config.json */,
51D4C9112BFD483E0029FCEA /* phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx */,
51D4C9132BFD483E0029FCEA /* phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data */,
51D4C9122BFD483E0029FCEA /* special_tokens_map.json */,
51D4C9142BFD483E0029FCEA /* tokenizer_config.json */,
51D4C9102BFD483E0029FCEA /* tokenizer.json */,
8ABA12A22CC300ED006B3DDF /* model */,
51D4C8D42BFD22D70029FCEA /* LocalLLM */,
51D4C8D32BFD22D70029FCEA /* Products */,
5156483B2BFDBB6E005CA50C /* Frameworks */,
Expand All @@ -119,6 +122,8 @@
51D4C8D42BFD22D70029FCEA /* LocalLLM */ = {
isa = PBXGroup;
children = (
8A869B212CDAD08600AE0604 /* LocalLLM.entitlements */,
8ABA12972CC1D15C006B3DDF /* Info.plist */,
51D4C9032BFD25BA0029FCEA /* lib */,
51D4C8FF2BFD25890029FCEA /* header */,
51D4C8D52BFD22D70029FCEA /* LocalLLMApp.swift */,
Expand Down Expand Up @@ -154,6 +159,7 @@
51D4C9032BFD25BA0029FCEA /* lib */ = {
isa = PBXGroup;
children = (
8A53DB0B2DAF08B3001D41D1 /* onnxruntime.framework */,
51D4C9052BFD26150029FCEA /* libonnxruntime-genai.dylib */,
);
path = lib;
Expand Down Expand Up @@ -189,7 +195,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1520;
LastUpgradeCheck = 1520;
LastUpgradeCheck = 1600;
TargetAttributes = {
51D4C8D12BFD22D70029FCEA = {
CreatedOnToolsVersion = 15.2;
Expand Down Expand Up @@ -245,7 +251,6 @@
51D4C8F42BFD22DC0029FCEA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -277,9 +282,10 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
ENABLE_MODULE_VERIFIER = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -299,7 +305,9 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
"MTL_ENABLE_DEBUG_INFO[sdk=iphoneos*]" = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -317,7 +325,6 @@
51D4C8F52BFD22DC0029FCEA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -352,6 +359,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
ENABLE_MODULE_VERIFIER = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -365,6 +373,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -385,12 +394,20 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = LocalLLM/LocalLLM.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"LocalLLM/Preview Content\"";
DEVELOPMENT_TEAM = UBF8T346G9;
DEVELOPMENT_TEAM = AL4J766FY4;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/LocalLLM/lib",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LocalLLM/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -407,6 +424,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLLM;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "LocalLLM/LocalLLM-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -421,12 +439,20 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = LocalLLM/LocalLLM.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"LocalLLM/Preview Content\"";
DEVELOPMENT_TEAM = UBF8T346G9;
DEVELOPMENT_TEAM = AL4J766FY4;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/LocalLLM/lib",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LocalLLM/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -441,8 +467,9 @@
"$(PROJECT_DIR)/LocalLLM/lib",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLLM;
PRODUCT_BUNDLE_IDENTIFIER = ai.onnxruntime.genai.demo.LocalLL;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "LocalLLM/LocalLLM-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
Loading
Loading