Post

Replies

Boosts

Views

Activity

Insufficient memory for Foundational Model Adapter Training
I have a MacBook Pro M3 Pro with 18GB of RAM and was following the instructions to fine tune the foundational model given here: https://developer.apple.com/apple-intelligence/foundation-models-adapter/ However, while following the code sample in the example Jupyter notebook, my Mac hangs on the second code cell. Specifically: from examples.generate import generate_content, GenerationConfiguration from examples.data import Message output = generate_content( [[ Message.from_system("A conversation between a user and a helpful assistant. Taking the role as a play writer assistant for a kids' play."), Message.from_user("Write a script about penguins.") ]], GenerationConfiguration(temperature=0.0, max_new_tokens=128) ) output[0].response After some debugging, I was getting the following error: RuntimeError: MPS backend out of memory (MPS allocated: 22.64 GB, other allocations: 5.78 MB, max allowed: 22.64 GB). Tried to allocate 52.00 MB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure). So is my machine not capable enough to adapter train Apple's Foundation Model? And if so, what's the recommended spec and could this be specified somewhere? Thanks!
8
1
202
Jun ’25
Is it possible to loop a ScrollView to repeat infinitely?
I have a horizontal scroll view and a fixed array. I would like to loop it such that when I scroll left and get near the end, the array will add the items in the beginning to the end so that the user can continue to scroll. I would like this to happen when scrolling both left and right and to not have the current position of the user jump around. Here is my code. What am I missing? Would appreciate any and all help. import SwiftUI import Algorithms struct ContentView: View { @State private var timePosition = ScrollPosition(idType: Int.self, edge: .leading) @State private var times: [Int] = Array(0...23) var body: some View { ScrollView(.horizontal, showsIndicators: false) { LazyHStack(spacing: 0) { ForEach(times, id:\.self) { time in Text("\(time)") .font(.system(.callout, design: .monospaced, weight: .semibold)) .padding(8) .frame(width: 180, height: 110, alignment: .topLeading) .border(width: 1, edges: [.leading, .trailing], color: .primary.opacity(0.05)) .id(time) } } .scrollTargetLayout() } .frame(height: 110) .scrollPosition($timeScrollPosition, anchor: .center) .onScrollTargetVisibilityChange(idType: Int.self) { timeIDs in if let currentViewID = model.timeScrollPosition.viewID { if timeIDs.contains(times[times.count - 2]) { times.rotate(toStartAt: times.count - 1) } if timeIDs.contains(times[1]) { times.rotate(toStartAt: times.count-1) } print("New times: \(times)") timeScrollPosition.scrollTo(id: currentViewID) } } } }
0
0
418
Jun ’24
RealityKit - Adding Real World Textures
Hello! I want to build an app that lets devices with the LiDAR Scanner scan their environment and share their scans with one another. As of now, I can create the mesh using the LiDAR Scanner and export it as an OBJ file. However, I would like the ability to map textures and colors onto this model. How would one go on to get the real world texture and place it onto the OBJ model? Thank you!
0
0
857
Aug ’21
How would I go about building AR effects similar to the AR Spaces features in Clips?
Hello! I really want to make these immersive AR experiences with engaging graphics like the new AR Spaces feature in the Clips app. Is RealityKit the way to go for this? Or does it require some really lower level understanding and use of API’s like ARKit with Metal? Also, with RealityKit’s scene understanding, we can map a mesh of the scene the LIDAR device can see but I was wondering how would I switch that out with a custom mesh design like in the Clips app as well. Thank you!
1
0
921
Jun ’21
Error: Cannot find 'DataFrame' in scope
Hello! I've been trying to replicate the linear regressor tabular application as shown at the end of the WWDC 2021 session Build dynamic iOS apps with the Create ML framework. However, I keep getting the error Cannot find 'DataFrame' in scope and Cannot find 'Column' in scope. I was wondering if this is a bug with the current beta or if I have my code wrong. I am trying to run my application on an iPhone 12 Pro running iOS 15 Beta 1. I am using Xcode 13 on Monterey. Thank you!
1
0
1.3k
Jun ’21
How to detect the "Change Scene" action from Reality Composer in Xcode
I have a Reality Composer project that has two scenes. In the first scene, I post a notification from Xcode to trigger an animation and then change the scene to the next scene. This is done using the Change Scene in the Action Sequence. In the second scene, when the user taps on an object, it should send a notification to Xcode using the Notify action. How do I set the .onAction in Xcode for the second scene if I switch to the second scene using an Action Sequence from the first scene? Thanks!
1
0
1.3k
Dec ’20