gpt4 book ai didi

ios - 集成到 ios 应用程序时出现 Pnet 模型问题

转载 作者:行者123 更新时间:2023-11-29 05:45:03 24 4
gpt4 key购买 nike

当我使用 pnet 模型时,我的 Xcode 是 10.1,该模型已转换为集成到 ios 应用程序,并且我看到错误

Incorrect argument label in call (have 'of:', expected 'rawValue:')

pnet.swift 中的以下行。我该如何解决这个问题:

convenience init() {
try! self.init(contentsOf: type(of:self).urlOfModelInThisBundle)
}

最佳答案

do {
try pnet(contentsOf: URL(fileURLWithPath: "your path here"))
} catch {
print(error.localizedDescription)
}

像这样尝试或者使用初始化器编写自己的子类

class pnet2: pnet {

convenience init() {
try! self.init(contentsOf: type(of:self).urlOfModelInThisBundle)
}

convenience init(hah: Bool = true) {
try! self.init(contentsOf: URL(fileURLWithPath: ""))
}

}

关于ios - 集成到 ios 应用程序时出现 Pnet 模型问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56230643/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com