diff --git a/examples/llama/App.tsx b/examples/llama/App.tsx index 6c85b12..da18960 100644 --- a/examples/llama/App.tsx +++ b/examples/llama/App.tsx @@ -1,7 +1,6 @@ import { useFonts } from 'expo-font'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import ChatScreen from './screens/ChatScreen'; -import StyleTransfer from './screens/StyleTransfer'; export default function App() { useFonts({ @@ -11,7 +10,7 @@ export default function App() { return ( - + ); } diff --git a/examples/llama/assets/style_transfer/android/candy_xnnpack_640_fp32.pte b/examples/llama/assets/style_transfer/android/candy_xnnpack_640_fp32.pte deleted file mode 100644 index bcfe99f..0000000 Binary files a/examples/llama/assets/style_transfer/android/candy_xnnpack_640_fp32.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/android/mosaic_xnnpack_640_fp32.pte b/examples/llama/assets/style_transfer/android/mosaic_xnnpack_640_fp32.pte deleted file mode 100644 index a173c62..0000000 Binary files a/examples/llama/assets/style_transfer/android/mosaic_xnnpack_640_fp32.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/android/rain_princess_xnnpack_640_fp32.pte b/examples/llama/assets/style_transfer/android/rain_princess_xnnpack_640_fp32.pte deleted file mode 100644 index c00cd77..0000000 Binary files a/examples/llama/assets/style_transfer/android/rain_princess_xnnpack_640_fp32.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/android/udnie_xnnpack_640_fp32.pte b/examples/llama/assets/style_transfer/android/udnie_xnnpack_640_fp32.pte deleted file mode 100644 index 5ac024c..0000000 Binary files a/examples/llama/assets/style_transfer/android/udnie_xnnpack_640_fp32.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/ios/__candy_coreml_all.pte b/examples/llama/assets/style_transfer/ios/__candy_coreml_all.pte deleted file mode 100644 index 4c99e1b..0000000 Binary files a/examples/llama/assets/style_transfer/ios/__candy_coreml_all.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/ios/__mosaic_coreml_all.pte b/examples/llama/assets/style_transfer/ios/__mosaic_coreml_all.pte deleted file mode 100644 index f2b23bc..0000000 Binary files a/examples/llama/assets/style_transfer/ios/__mosaic_coreml_all.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/ios/__rain_princess_coreml_all.pte b/examples/llama/assets/style_transfer/ios/__rain_princess_coreml_all.pte deleted file mode 100644 index eb15416..0000000 Binary files a/examples/llama/assets/style_transfer/ios/__rain_princess_coreml_all.pte and /dev/null differ diff --git a/examples/llama/assets/style_transfer/ios/__udnie_coreml_all.pte b/examples/llama/assets/style_transfer/ios/__udnie_coreml_all.pte deleted file mode 100644 index f60be79..0000000 Binary files a/examples/llama/assets/style_transfer/ios/__udnie_coreml_all.pte and /dev/null differ diff --git a/examples/llama/ios/Podfile.lock b/examples/llama/ios/Podfile.lock index fc0dc39..91bef94 100644 --- a/examples/llama/ios/Podfile.lock +++ b/examples/llama/ios/Podfile.lock @@ -1277,28 +1277,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-executorch (0.1.504): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly (= 2024.01.01.00) - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-NativeModulesApple - - React-RCTFabric - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - Yoga - - react-native-image-picker (7.2.2): + - react-native-executorch (0.1.3): - DoubleConversion - glog - hermes-engine @@ -1831,7 +1810,6 @@ DEPENDENCIES: - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) - React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) - react-native-executorch (from `../node_modules/react-native-executorch`) - - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - React-nativeconfig (from `../node_modules/react-native/ReactCommon`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) @@ -1956,8 +1934,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" react-native-executorch: :path: "../node_modules/react-native-executorch" - react-native-image-picker: - :path: "../node_modules/react-native-image-picker" react-native-safe-area-context: :path: "../node_modules/react-native-safe-area-context" React-nativeconfig: @@ -2064,8 +2040,7 @@ SPEC CHECKSUMS: React-logger: 26155dc23db5c9038794db915f80bd2044512c2e React-Mapbuffer: ad1ba0205205a16dbff11b8ade6d1b3959451658 React-microtasksnativemodule: e771eb9eb6ace5884ee40a293a0e14a9d7a4343c - react-native-executorch: b336f7e2290e8d1a280c98bb822dd2fed9578496 - react-native-image-picker: bfb56e2b39dc63abfcc6de44ee239c6633f47d66 + react-native-executorch: 8bb22fa382560ec6b48679f1d82ebd752e5cecb5 react-native-safe-area-context: 2500e4fe998caad50ad3bc51ec23ef951308569e React-nativeconfig: aeed6e2a8ac02b2df54476afcc7c663416c12bf7 React-NativeModulesApple: c5b7813da94136f50ef084fa1ac077332dcfc658 diff --git a/examples/llama/ios/llama.xcodeproj/project.pbxproj b/examples/llama/ios/llama.xcodeproj/project.pbxproj index 6d0a177..89fb220 100644 --- a/examples/llama/ios/llama.xcodeproj/project.pbxproj +++ b/examples/llama/ios/llama.xcodeproj/project.pbxproj @@ -250,12 +250,12 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-llama/Pods-llama-frameworks.sh", "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/react-native-executorch/ExecutorchLib.framework/ExecutorchLib", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/react-native-executorch/LLaMARunner.framework/LLaMARunner", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ExecutorchLib.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LLaMARunner.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -317,7 +317,6 @@ "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/react-native-image-picker/RNImagePickerPrivacyInfo.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -328,7 +327,6 @@ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImagePickerPrivacyInfo.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/examples/llama/package.json b/examples/llama/package.json index 6b365ce..4bb62a3 100644 --- a/examples/llama/package.json +++ b/examples/llama/package.json @@ -16,8 +16,7 @@ "metro-config": "^0.81.0", "react": "18.3.1", "react-native": "0.76.3", - "react-native-executorch": "^0.1.2", - "react-native-image-picker": "^7.2.2", + "react-native-executorch": "^0.1.3", "react-native-loading-spinner-overlay": "^3.0.1", "react-native-markdown-display": "^7.0.2", "react-native-reanimated": "^3.16.3", diff --git a/examples/llama/screens/StyleTransfer.tsx b/examples/llama/screens/StyleTransfer.tsx deleted file mode 100644 index 46e6ba4..0000000 --- a/examples/llama/screens/StyleTransfer.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import { useState } from 'react'; -import { - Text, - View, - StyleSheet, - SafeAreaView, - TouchableOpacity, - Image, - Button, - Platform, -} from 'react-native'; -import { getImageUri } from '../utils/utils'; -import { useStyleTransfer } from 'react-native-executorch'; - -export default function StyleTransfer() { - const [imageUri, setImageUri] = useState(''); - const iosmModel = require('../assets/style_transfer/ios/__candy_coreml_all.pte'); - const androidModel = require('../assets/style_transfer/android/candy_xnnpack_640_fp32.pte'); - const model = useStyleTransfer({ - modulePath: Platform.OS === 'ios' ? iosmModel : androidModel, - }); - - const handleCameraPress = async (isCamera: boolean) => { - const imageUri = await getImageUri(isCamera); - if (typeof imageUri === 'string') { - setImageUri(imageUri as string); - } - }; - if (model.isModelLoading) { - return ( - - - Loading model... - - - ); - } - - return ( - - - Image editor - - {imageUri && ( - - )} - - - await handleCameraPress(true)}> - Camera - - await handleCameraPress(false)} - > - Gallery - - - - Filters -