Some weird things are happening. Someone on the iOS-developers Slack channel figured this out:
// This fails
@State private var session = LanguageModelSession()
// This works
@State private var session = LanguageModelSession(guardrails:.default)
I verified this fixed it a few hours ago, but now:
After a few hours both started working fine, like Apple fixed the model remotely. Is that possible?
There's a secondary problem where model results are cached EVEN IF AN ERROR OCCURS. This means that if the session returns an error for whatever reason, including a temporary Apple bug, the identical query will continue to return the same cached error even after quitting and re-running the app. Unfortunately I can't submit a bug report on this because I can't force an error any longer.
Please let me know if this is fixed for you now or if you need to add the guardrails parameter.
Topic:
Machine Learning & AI
SubTopic:
Foundation Models