diff --git a/Sources/Models/LanguageModel.swift b/Sources/Models/LanguageModel.swift index 044fd19..07bc381 100644 --- a/Sources/Models/LanguageModel.swift +++ b/Sources/Models/LanguageModel.swift @@ -471,7 +471,7 @@ public class LanguageModelWithStatefulKVCache: LanguageModel { Keys.inputIds: inputIds ] if isRequiringAttentionMask { - #if !((os(macOS) || (macCatalyst)) && arch(x86_64)) + #if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64)) // TODO: Infer scalar type from cache or model I/O descriptors let attentionMask = MLTensor(zeros: [1, 1, 1, tokenCount + 1], scalarType: Float16.self) inputDictionary[Keys.attentionMask] = attentionMask