diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.h b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.h similarity index 93% rename from examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.h rename to examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.h index 1290a75d975..6d58d41db1c 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.h +++ b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.h @@ -10,11 +10,11 @@ NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXPORT NSErrorDomain const LLaMARunnerErrorDomain; +FOUNDATION_EXPORT NSErrorDomain const LLMRunnerErrorDomain; FOUNDATION_EXPORT NSErrorDomain const LLaVARunnerErrorDomain; NS_SWIFT_NAME(Runner) -@interface LLaMARunner : NSObject +@interface LLMRunner : NSObject - (instancetype)initWithModelPath:(NSString*)filePath tokenizerPath:(NSString*)tokenizerPath; diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.mm b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.mm similarity index 93% rename from examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.mm rename to examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.mm index fc7f440d999..40619669be5 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported/LLaMARunner.mm +++ b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/Exported/LLMRunner.mm @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "LLaMARunner.h" +#import "LLMRunner.h" #import #import @@ -17,13 +17,13 @@ using executorch::extension::llm::TextLLMRunner; using executorch::runtime::Error; -NSErrorDomain const LLaMARunnerErrorDomain = @"LLaMARunnerErrorDomain"; +NSErrorDomain const LLMRunnerErrorDomain = @"LLMRunnerErrorDomain"; NSErrorDomain const LLaVARunnerErrorDomain = @"LLaVARunnerErrorDomain"; -@interface LLaMARunner () +@interface LLMRunner () @end -@implementation LLaMARunner { +@implementation LLMRunner { std::unique_ptr _runner; } @@ -50,7 +50,7 @@ - (BOOL)loadWithError:(NSError**)error { const auto status = _runner->load(); if (status != Error::Ok) { if (error) { - *error = [NSError errorWithDomain:LLaMARunnerErrorDomain + *error = [NSError errorWithDomain:LLMRunnerErrorDomain code:(NSInteger)status userInfo:nil]; } @@ -72,7 +72,7 @@ - (BOOL)generate:(NSString*)prompt }); if (status != Error::Ok) { if (error) { - *error = [NSError errorWithDomain:LLaMARunnerErrorDomain + *error = [NSError errorWithDomain:LLMRunnerErrorDomain code:(NSInteger)status userInfo:nil]; return NO; @@ -170,7 +170,7 @@ - (BOOL)generate:(void*)imageBuffer [callback](const std::string& token) { callback(@(token.c_str())); }); if (status != Error::Ok) { if (error) { - *error = [NSError errorWithDomain:LLaMARunnerErrorDomain + *error = [NSError errorWithDomain:LLMRunnerErrorDomain code:(NSInteger)status userInfo:nil]; return NO; diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/__tests__/RunnerTest.swift b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/__tests__/RunnerTest.swift similarity index 97% rename from examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/__tests__/RunnerTest.swift rename to examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/__tests__/RunnerTest.swift index 7175ea42291..75e39c90818 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/LLaMARunner/__tests__/RunnerTest.swift +++ b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/LLMRunner/__tests__/RunnerTest.swift @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ -@testable import LLaMARunner +@testable import LLMRunner import XCTest diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMARunner/TARGETS b/examples/demo-apps/apple_ios/LLaMA/LLMRunner/TARGETS similarity index 100% rename from examples/demo-apps/apple_ios/LLaMA/LLaMARunner/TARGETS rename to examples/demo-apps/apple_ios/LLaMA/LLMRunner/TARGETS diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/project.pbxproj b/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/project.pbxproj index 042f3903c67..bc1782148fd 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/project.pbxproj +++ b/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/project.pbxproj @@ -17,9 +17,9 @@ 0324D6922BAACB6900DEF36F /* ResourceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0324D6872BAACB6900DEF36F /* ResourceManager.swift */; }; 0324D6932BAACB6900DEF36F /* ResourceMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0324D6882BAACB6900DEF36F /* ResourceMonitor.swift */; }; 0324D6962BAACB7000DEF36F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0324D6942BAACB7000DEF36F /* Assets.xcassets */; }; - 03729EDC2BB1F8DE00152F2E /* LLaMARunner.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 03729ED52BB1F8DE00152F2E /* LLaMARunner.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 03729EE12BB1F93800152F2E /* LLaMARunner.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0324D69A2BAACB7C00DEF36F /* LLaMARunner.mm */; }; - 03729EE22BB1F93E00152F2E /* LLaMARunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 0324D6992BAACB7C00DEF36F /* LLaMARunner.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 03729EDC2BB1F8DE00152F2E /* LLMRunner.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 03729ED52BB1F8DE00152F2E /* LLMRunner.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 03729EE12BB1F93800152F2E /* LLMRunner.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0324D69A2BAACB7C00DEF36F /* LLMRunner.mm */; }; + 03729EE22BB1F93E00152F2E /* LLMRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 0324D6992BAACB7C00DEF36F /* LLMRunner.h */; settings = {ATTRIBUTES = (Public, ); }; }; 03729F0A2BB203B300152F2E /* runner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03729F072BB203B300152F2E /* runner.cpp */; }; 03729F0B2BB203B300152F2E /* runner.h in Headers */ = {isa = PBXBuildFile; fileRef = 03729F082BB203B300152F2E /* runner.h */; }; 03729F0C2BB203B300152F2E /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 03729F092BB203B300152F2E /* util.h */; }; @@ -84,7 +84,7 @@ containerPortal = 032C01672AC228E5002955E1 /* Project object */; proxyType = 1; remoteGlobalIDString = 03729ED42BB1F8DE00152F2E; - remoteInfo = LLaMARunner; + remoteInfo = LLMRunner; }; /* End PBXContainerItemProxy section */ @@ -95,7 +95,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 03729EDC2BB1F8DE00152F2E /* LLaMARunner.framework in Embed Frameworks */, + 03729EDC2BB1F8DE00152F2E /* LLMRunner.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -114,11 +114,11 @@ 0324D6872BAACB6900DEF36F /* ResourceManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResourceManager.swift; sourceTree = ""; }; 0324D6882BAACB6900DEF36F /* ResourceMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResourceMonitor.swift; sourceTree = ""; }; 0324D6942BAACB7000DEF36F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 0324D6992BAACB7C00DEF36F /* LLaMARunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLaMARunner.h; sourceTree = ""; }; - 0324D69A2BAACB7C00DEF36F /* LLaMARunner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LLaMARunner.mm; sourceTree = ""; }; + 0324D6992BAACB7C00DEF36F /* LLMRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLMRunner.h; sourceTree = ""; }; + 0324D69A2BAACB7C00DEF36F /* LLMRunner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LLMRunner.mm; sourceTree = ""; }; 035A5E942BB4B523001E0553 /* LLaMA.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = LLaMA.entitlements; sourceTree = ""; }; 036CAF9D2BB1444500D6C2D5 /* LLaMA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LLaMA.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 03729ED52BB1F8DE00152F2E /* LLaMARunner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LLaMARunner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 03729ED52BB1F8DE00152F2E /* LLMRunner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LLMRunner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 03729F072BB203B300152F2E /* runner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = runner.cpp; path = ../../../examples/models/llama/runner/runner.cpp; sourceTree = ""; }; 03729F082BB203B300152F2E /* runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = runner.h; path = ../../../examples/models/llama/runner/runner.h; sourceTree = ""; }; 03729F092BB203B300152F2E /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; @@ -245,13 +245,13 @@ 0324D69B2BAACB7C00DEF36F /* Exported */ = { isa = PBXGroup; children = ( - 0324D6992BAACB7C00DEF36F /* LLaMARunner.h */, - 0324D69A2BAACB7C00DEF36F /* LLaMARunner.mm */, + 0324D6992BAACB7C00DEF36F /* LLMRunner.h */, + 0324D69A2BAACB7C00DEF36F /* LLMRunner.mm */, ); path = Exported; sourceTree = ""; }; - 0324D69C2BAACB7C00DEF36F /* LLaMARunner */ = { + 0324D69C2BAACB7C00DEF36F /* LLMRunner */ = { isa = PBXGroup; children = ( 0324D69B2BAACB7C00DEF36F /* Exported */, @@ -259,15 +259,15 @@ 03729F0F2BB203E100152F2E /* sampler */, 03729F0E2BB203D700152F2E /* tokenizers */, ); - path = LLaMARunner; + path = LLMRunner; sourceTree = ""; }; - 0324D69F2BAACB7C00DEF36F /* LLaMARunner */ = { + 0324D69F2BAACB7C00DEF36F /* LLMRunner */ = { isa = PBXGroup; children = ( - 0324D69C2BAACB7C00DEF36F /* LLaMARunner */, + 0324D69C2BAACB7C00DEF36F /* LLMRunner */, ); - path = LLaMARunner; + path = LLMRunner; sourceTree = ""; }; 032C01662AC228E5002955E1 = { @@ -276,9 +276,9 @@ 0324D68A2BAACB6900DEF36F /* LLaMA */, 0324D6952BAACB7000DEF36F /* LLaMAAssets */, 035A5E952BB4B523001E0553 /* LLaMAEntitlements */, - 0324D69F2BAACB7C00DEF36F /* LLaMARunner */, + 0324D69F2BAACB7C00DEF36F /* LLMRunner */, 036CAF9D2BB1444500D6C2D5 /* LLaMA.app */, - 03729ED52BB1F8DE00152F2E /* LLaMARunner.framework */, + 03729ED52BB1F8DE00152F2E /* LLMRunner.framework */, ); sourceTree = ""; }; @@ -384,7 +384,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 03729EE22BB1F93E00152F2E /* LLaMARunner.h in Headers */, + 03729EE22BB1F93E00152F2E /* LLMRunner.h in Headers */, 03D03DA82C7823620088D6A7 /* text_prefiller.h in Headers */, F292B0882D88B0D200BE6839 /* llama2c_tokenizer.h in Headers */, F292B0892D88B0D200BE6839 /* tokenizer.h in Headers */, @@ -435,9 +435,9 @@ productReference = 036CAF9D2BB1444500D6C2D5 /* LLaMA.app */; productType = "com.apple.product-type.application"; }; - 03729ED42BB1F8DE00152F2E /* LLaMARunner */ = { + 03729ED42BB1F8DE00152F2E /* LLMRunner */ = { isa = PBXNativeTarget; - buildConfigurationList = 03729EDD2BB1F8DE00152F2E /* Build configuration list for PBXNativeTarget "LLaMARunner" */; + buildConfigurationList = 03729EDD2BB1F8DE00152F2E /* Build configuration list for PBXNativeTarget "LLMRunner" */; buildPhases = ( 03641D7C2C409960004AF8DE /* Build Cmake Dependencies */, 03729ED02BB1F8DE00152F2E /* Headers */, @@ -449,7 +449,7 @@ ); dependencies = ( ); - name = LLaMARunner; + name = LLMRunner; packageProductDependencies = ( 03CF43952CEC5CEC00C7113B /* backend_coreml */, 03CF43972CEC5CEC00C7113B /* backend_coreml_debug */, @@ -467,8 +467,8 @@ 03CF43AF2CEC5CEC00C7113B /* kernels_quantized */, 03CF43B12CEC5CEC00C7113B /* kernels_quantized_debug */, ); - productName = LLaMARunner; - productReference = 03729ED52BB1F8DE00152F2E /* LLaMARunner.framework */; + productName = LLMRunner; + productReference = 03729ED52BB1F8DE00152F2E /* LLMRunner.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -506,7 +506,7 @@ projectRoot = ""; targets = ( 032C016E2AC228E6002955E1 /* LLaMA */, - 03729ED42BB1F8DE00152F2E /* LLaMARunner */, + 03729ED42BB1F8DE00152F2E /* LLMRunner */, ); }; /* End PBXProject section */ @@ -574,7 +574,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 03729EE12BB1F93800152F2E /* LLaMARunner.mm in Sources */, + 03729EE12BB1F93800152F2E /* LLMRunner.mm in Sources */, 0372C3152C89418E00CD942A /* llava_runner.cpp in Sources */, F292B1022D88B20C00BE6839 /* llama_tiktoken.cpp in Sources */, 03D03DAB2C7823830088D6A7 /* text_decoder_runner.cpp in Sources */, @@ -599,7 +599,7 @@ /* Begin PBXTargetDependency section */ 03729EDA2BB1F8DE00152F2E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 03729ED42BB1F8DE00152F2E /* LLaMARunner */; + target = 03729ED42BB1F8DE00152F2E /* LLMRunner */; targetProxy = 03729ED92BB1F8DE00152F2E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -830,7 +830,7 @@ MARKETING_VERSION = 1.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; - PRODUCT_BUNDLE_IDENTIFIER = org.pytorch.executorch.illama.LLaMARunner; + PRODUCT_BUNDLE_IDENTIFIER = org.pytorch.executorch.illama.LLMRunner; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -866,7 +866,7 @@ MARKETING_VERSION = 1.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; - PRODUCT_BUNDLE_IDENTIFIER = org.pytorch.executorch.illama.LLaMARunner; + PRODUCT_BUNDLE_IDENTIFIER = org.pytorch.executorch.illama.LLMRunner; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -901,7 +901,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 03729EDD2BB1F8DE00152F2E /* Build configuration list for PBXNativeTarget "LLaMARunner" */ = { + 03729EDD2BB1F8DE00152F2E /* Build configuration list for PBXNativeTarget "LLMRunner" */ = { isa = XCConfigurationList; buildConfigurations = ( 03729EDE2BB1F8DE00152F2E /* Debug */, diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/xcshareddata/xcschemes/LLaMARunner.xcscheme b/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/xcshareddata/xcschemes/LLaMARunner.xcscheme index d820e0a5f8a..8dbfe5b155a 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/xcshareddata/xcschemes/LLaMARunner.xcscheme +++ b/examples/demo-apps/apple_ios/LLaMA/LLaMA.xcodeproj/xcshareddata/xcschemes/LLaMARunner.xcscheme @@ -16,8 +16,8 @@ @@ -51,8 +51,8 @@ diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMA/Application/ContentView.swift b/examples/demo-apps/apple_ios/LLaMA/LLaMA/Application/ContentView.swift index 52f18f7a5ea..ced659379d0 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMA/Application/ContentView.swift +++ b/examples/demo-apps/apple_ios/LLaMA/LLaMA/Application/ContentView.swift @@ -9,7 +9,7 @@ import SwiftUI import UniformTypeIdentifiers -import LLaMARunner +import LLMRunner class RunnerHolder: ObservableObject { var runner: Runner? @@ -87,7 +87,7 @@ struct ContentView: View { case llava case qwen3 case phi4 - + static func fromPath(_ path: String) -> ModelType { let filename = (path as NSString).lastPathComponent.lowercased() if filename.hasPrefix("llama") { diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Debug.xcconfig b/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Debug.xcconfig index 4db30506e82..74db67917d7 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Debug.xcconfig +++ b/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Debug.xcconfig @@ -12,12 +12,12 @@ OTHER_LDFLAGS = $(inherited) \ -force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized_debug_$(ET_PLATFORM).a \ @$(TEMP_DIR)/cmake/linker_flags -// LLaMARunner requires additional dependencies built with CMake in a custom run script phase. +// LLMRunner requires additional dependencies built with CMake in a custom run script phase. // Include headers and libraries from $(TEMP_DIR)/cmake for it. HEADER_SEARCH_PATHS = $(inherited) \ $(SRCROOT)/../../../../.. \ $(TEMP_DIR)/cmake/include \ - $(SRCROOT)/../../../../extension/llm/tokenizers/include + $(SRCROOT)/../../../../extension/llm/tokenizers/include LIBRARY_SEARCH_PATHS = $(inherited) \ $(TEMP_DIR)/cmake/lib diff --git a/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Release.xcconfig b/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Release.xcconfig index d30a2c7957b..9faa0c4bb0c 100644 --- a/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Release.xcconfig +++ b/examples/demo-apps/apple_ios/LLaMA/LLaMA/SupportingFiles/Release.xcconfig @@ -14,7 +14,7 @@ OTHER_LDFLAGS = $(inherited) \ -force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized_$(ET_PLATFORM).a \ @$(TEMP_DIR)/cmake/linker_flags -// LLaMARunner requires additional dependencies built with CMake in a custom run script phase. +// LLMRunner requires additional dependencies built with CMake in a custom run script phase. // Include headers and libraries from $(TEMP_DIR)/cmake for it. HEADER_SEARCH_PATHS = $(inherited) \ $(SRCROOT)/../../../../.. \ diff --git a/examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md b/examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md index de5b3b9ab27..7b71f80011e 100644 --- a/examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md +++ b/examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md @@ -152,14 +152,14 @@ The following packages should be linked in your app target `LLaMA` (left side, L - kernels_portable - kernels_quantized -The following package should be linked in your target app `LLaMARunner` (left side, LLaMA --> General --> select LLaMARunner under "TARGETS" --> scroll down to "Frameworks and Libraries") +The following package should be linked in your target app `LLMRunner` (left side, LLaMA --> General --> select LLMRunner under "TARGETS" --> scroll down to "Frameworks and Libraries") - executorch

iOS LLaMA App Choosing package

-If you cannot add the package into your app target (it's greyed out), it might have been linked before. You can verify it by checking it from your target app `(LLaMA / LLaMARunner) --> Build Phases --> Link Binary With Libraries`. +If you cannot add the package into your app target (it's greyed out), it might have been linked before. You can verify it by checking it from your target app `(LLaMA / LLMRunner) --> Build Phases --> Link Binary With Libraries`. diff --git a/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.h b/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.h index eaac0708e83..fa2d5d48fa4 100644 --- a/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.h +++ b/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.h @@ -3,12 +3,12 @@ #import #import -#import "LLaMARunner.h" +#import "LLMRunner.h" NS_ASSUME_NONNULL_BEGIN @interface LLaMABridge : RCTEventEmitter -@property (nonatomic, strong) LLaMARunner *runner; +@property (nonatomic, strong) LLMRunner *runner; @end NS_ASSUME_NONNULL_END diff --git a/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.mm b/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.mm index 65a3e003f7c..c65dceb67bc 100644 --- a/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.mm +++ b/examples/demo-apps/react-native/rnllama/ios/LlamaBridge.mm @@ -17,14 +17,14 @@ + (BOOL)requiresMainQueueSetup { resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - self.runner = [[LLaMARunner alloc] initWithModelPath:modelPath tokenizerPath:tokenizerPath]; - + self.runner = [[LLMRunner alloc] initWithModelPath:modelPath tokenizerPath:tokenizerPath]; + NSError *error = nil; if (![self.runner loadWithError:&error]) { reject(@"load_error", error.localizedDescription, error); return; } - + resolve(@YES); }); } @@ -40,12 +40,12 @@ + (BOOL)requiresMainQueueSetup { withTokenCallback:^(NSString *token) { [self sendEventWithName:@"onToken" body:token]; } error:&error]; - + if (!success) { reject(@"generation_error", error.localizedDescription, error); return; } - + resolve(@YES); }); } @@ -56,4 +56,4 @@ + (BOOL)requiresMainQueueSetup { }); } -@end \ No newline at end of file +@end diff --git a/examples/demo-apps/react-native/rnllama/ios/Release.xcconfig b/examples/demo-apps/react-native/rnllama/ios/Release.xcconfig index 6893e1252e7..267cb4309f6 100644 --- a/examples/demo-apps/react-native/rnllama/ios/Release.xcconfig +++ b/examples/demo-apps/react-native/rnllama/ios/Release.xcconfig @@ -14,7 +14,7 @@ OTHER_LDFLAGS = $(inherited) \ -force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized_$(ET_PLATFORM).a \ @$(TEMP_DIR)/cmake/linker_flags -// LLaMARunner requires additional dependencies built with CMake in a custom run script phase. +// LLMRunner requires additional dependencies built with CMake in a custom run script phase. // Include headers and libraries from $(TEMP_DIR)/cmake for it. HEADER_SEARCH_PATHS = $(inherited) \ $(SRCROOT)/../../../../../.. \ diff --git a/examples/demo-apps/react-native/rnllama/ios/rnllama.xcodeproj/project.pbxproj b/examples/demo-apps/react-native/rnllama/ios/rnllama.xcodeproj/project.pbxproj index 1a56daafaea..d461dc36abc 100644 --- a/examples/demo-apps/react-native/rnllama/ios/rnllama.xcodeproj/project.pbxproj +++ b/examples/demo-apps/react-native/rnllama/ios/rnllama.xcodeproj/project.pbxproj @@ -26,8 +26,8 @@ E931C68A2CFAF3A500DA599B /* kernels_optimized in Frameworks */ = {isa = PBXBuildFile; productRef = E931C6892CFAF3A500DA599B /* kernels_optimized */; }; E931C68C2CFAF3AC00DA599B /* kernels_portable in Frameworks */ = {isa = PBXBuildFile; productRef = E931C68B2CFAF3AC00DA599B /* kernels_portable */; }; E931C68E2CFAF3B200DA599B /* kernels_quantized in Frameworks */ = {isa = PBXBuildFile; productRef = E931C68D2CFAF3B200DA599B /* kernels_quantized */; }; - E931C6A72CFBD70E00DA599B /* LLaMARunner.h in Headers */ = {isa = PBXBuildFile; fileRef = E931C6A42CFBD70E00DA599B /* LLaMARunner.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E931C6A82CFBD70E00DA599B /* LLaMARunner.mm in Sources */ = {isa = PBXBuildFile; fileRef = E931C6A52CFBD70E00DA599B /* LLaMARunner.mm */; }; + E931C6A72CFBD70E00DA599B /* LLMRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = E931C6A42CFBD70E00DA599B /* LLMRunner.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E931C6A82CFBD70E00DA599B /* LLMRunner.mm in Sources */ = {isa = PBXBuildFile; fileRef = E931C6A52CFBD70E00DA599B /* LLMRunner.mm */; }; E931C6F62CFBD7FF00DA599B /* runner.h in Headers */ = {isa = PBXBuildFile; fileRef = E931C6ED2CFBD7FF00DA599B /* runner.h */; }; E931C6F72CFBD7FF00DA599B /* llava_runner.h in Headers */ = {isa = PBXBuildFile; fileRef = E931C6EE2CFBD7FF00DA599B /* llava_runner.h */; }; E931C6F82CFBD7FF00DA599B /* text_prefiller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E931C6EF2CFBD7FF00DA599B /* text_prefiller.cpp */; }; @@ -92,8 +92,8 @@ E931C6412CFAF07E00DA599B /* LlamaRunner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LlamaRunner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E931C67D2CFAF16000DA599B /* LlamaBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LlamaBridge.h; sourceTree = ""; }; E931C67E2CFAF17500DA599B /* LlamaBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LlamaBridge.mm; sourceTree = ""; }; - E931C6A42CFBD70E00DA599B /* LLaMARunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLaMARunner.h; sourceTree = ""; }; - E931C6A52CFBD70E00DA599B /* LLaMARunner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LLaMARunner.mm; sourceTree = ""; }; + E931C6A42CFBD70E00DA599B /* LLMRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLMRunner.h; sourceTree = ""; }; + E931C6A52CFBD70E00DA599B /* LLMRunner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LLMRunner.mm; sourceTree = ""; }; E931C6ED2CFBD7FF00DA599B /* runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = runner.h; path = ../../../examples/models/llama/runner/runner.h; sourceTree = ""; }; E931C6EE2CFBD7FF00DA599B /* llava_runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = llava_runner.h; path = ../../../examples/models/llava/runner/llava_runner.h; sourceTree = ""; }; E931C6EF2CFBD7FF00DA599B /* text_prefiller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = text_prefiller.cpp; sourceTree = ""; }; @@ -263,11 +263,11 @@ E931C6A62CFBD70E00DA599B /* Exported */ = { isa = PBXGroup; children = ( - E931C6A42CFBD70E00DA599B /* LLaMARunner.h */, - E931C6A52CFBD70E00DA599B /* LLaMARunner.mm */, + E931C6A42CFBD70E00DA599B /* LLMRunner.h */, + E931C6A52CFBD70E00DA599B /* LLMRunner.mm */, ); name = Exported; - path = ../../../../../apple_ios/LLaMA/LLaMARunner/LLaMARunner/Exported; + path = ../../../../../apple_ios/LLaMA/LLMRunner/LLMRunner/Exported; sourceTree = ""; }; E931C6B72CFBD74400DA599B /* runner */ = { @@ -330,7 +330,7 @@ E931C6F92CFBD7FF00DA599B /* text_decoder_runner.h in Headers */, E931C70F2CFBD81E00DA599B /* bpe_tokenizer.h in Headers */, E931C7112CFBD81E00DA599B /* llama_tiktoken.h in Headers */, - E931C6A72CFBD70E00DA599B /* LLaMARunner.h in Headers */, + E931C6A72CFBD70E00DA599B /* LLMRunner.h in Headers */, E931C7102CFBD81E00DA599B /* tiktoken.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -604,7 +604,7 @@ E931C70E2CFBD81E00DA599B /* bpe_tokenizer.cpp in Sources */, E931C6FE2CFBD7FF00DA599B /* runner.cpp in Sources */, E931C70C2CFBD81E00DA599B /* llama_tiktoken.cpp in Sources */, - E931C6A82CFBD70E00DA599B /* LLaMARunner.mm in Sources */, + E931C6A82CFBD70E00DA599B /* LLMRunner.mm in Sources */, E931C6FC2CFBD7FF00DA599B /* text_decoder_runner.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/extension/benchmark/apple/Benchmark/Tests/Tests.xcconfig b/extension/benchmark/apple/Benchmark/Tests/Tests.xcconfig index bf915abc25b..0de989472e4 100644 --- a/extension/benchmark/apple/Benchmark/Tests/Tests.xcconfig +++ b/extension/benchmark/apple/Benchmark/Tests/Tests.xcconfig @@ -12,7 +12,7 @@ OTHER_LDFLAGS = $(inherited) \ -force_load $(BUILT_PRODUCTS_DIR)/libkernels_quantized_$(ET_PLATFORM).a \ @$(TEMP_DIR)/cmake/linker_flags -// LLaMARunner requires additional dependencies built with CMake in a custom run script phase. +// LLMRunner requires additional dependencies built with CMake in a custom run script phase. // Include headers and libraries from $(TEMP_DIR)/cmake for it. HEADER_SEARCH_PATHS = $(inherited) \ $(SRCROOT)/../../../../.. \