Fix compilation for iOS

main
Pedro Cuenca 2 years ago
parent 1084ea79f4
commit 59da886875

@ -41,8 +41,12 @@ struct ModelInfo {
extension ModelInfo { extension ModelInfo {
static var defaultAttention: AttentionVariant { static var defaultAttention: AttentionVariant {
guard runningOnMac else { return .splitEinsum } guard runningOnMac else { return .splitEinsum }
#if os(macOS)
guard Capabilities.hasANE else { return .original } guard Capabilities.hasANE else { return .original }
return Capabilities.performanceCores >= 8 ? .original : .splitEinsum return Capabilities.performanceCores >= 8 ? .original : .splitEinsum
#else
return .splitEinsum
#endif
} }
var bestAttention: AttentionVariant { var bestAttention: AttentionVariant {

@ -88,6 +88,8 @@ struct ImageWithPlaceholder: View {
}) })
case .failed(_): case .failed(_):
return AnyView(Image(systemName: "exclamationmark.triangle").resizable()) return AnyView(Image(systemName: "exclamationmark.triangle").resizable())
case .userCanceled:
return AnyView(Text("Generation canceled"))
} }
} }
} }

Loading…
Cancel
Save