Skip to content

Commit

Permalink
fix(example): remove default props
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Nov 8, 2024
1 parent 7c6c6fc commit 413dc6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
FBLazyVector: 4b1589d37c9ff4dba11a63083fe7515fad3ac111
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
hermes-engine: 2102c92e54a031a270fd1fe84169ec8a0901b7bd
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: 5f1d7e1f8ef6c53f0207e3ac0d0ca23575e8a6ab
Expand Down
7 changes: 4 additions & 3 deletions example/src/Bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,18 @@ export default function Bench() {
log(`${modelName} not found, skipping`)
return
}
const useGpu = Platform.OS === 'ios'
const ctx = await initWhisper({
filePath,
useCoreMLIos: false,
useGpu: Platform.OS === 'ios',
useFlashAttn: Platform.OS === 'ios',
useGpu,
useFlashAttn: useGpu,
})
const fa = useGpu ? '1' : '0'
try {
const result = await ctx.bench(-1)
const { config, nThreads, nEncode, nDecode, nBatchd, nPrompt } =
result
const fa = Platform.OS === 'ios' ? '1' : '0'
const systemInfo = config
.split(' ')
.filter((c) => ['NEON', 'BLAS', 'METAL'].includes(c))
Expand Down
13 changes: 2 additions & 11 deletions example/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ const styles = StyleSheet.create({
},
})

export function Button({
style,
title,
onPress,
disabled,
}: {
export function Button(options: {
style?: StyleProp<ViewStyle>
title: string
onPress: () => void
disabled?: boolean
}) {
const { style, title, onPress, disabled } = options
return (
<TouchableOpacity
style={[styles.button, style]}
Expand All @@ -38,8 +34,3 @@ export function Button({
</TouchableOpacity>
)
}

Button.defaultProps = {
style: undefined,
disabled: false,
}

0 comments on commit 413dc6d

Please sign in to comment.