0

因此,我在网上阅读了无数关于 Git LFS 及其工作原理的文章,但仍然无法为我的问题找到最终的解决方案。基本上,我正在使用 Mozilla Deepspeech,我正在尝试通过 Github 将我的项目上传到 Heroku。但是,由于 Deepspeech 文件很大,必须使用 Git LFS 上传。这很好,除了现在当我访问文件路径时,我收到指向具有 SHA256 ID 的文件的指针,而不是实际的二进制文件。我想知道是否没有办法解决这个问题,或者是否可以接收实际的文件内容。谢谢您的帮助。代码如下(顺便说一句,这是正确的路径)

const DeepSpeech = require('deepspeech')
let modelPath = './deepspeech/deepspeech-0.9.3-models.pbmm'
let scorerPath = './deepspeech/deepspeech-0.9.3-models.scorer'

let model = new DeepSpeech.Model(modelPath)
model.enableExternalScorer(scorerPath)
Data loss: Corrupted memmapped model file: ./deepspeech/deepspeech-0.9.3-models.pbmm Invalid directory offset
throw `CreateModel failed: ${binding.ErrorCodeToErrorMessage(status)} (0x${status.toString(16)})`;
CreateModel failed: Failed to initialize memory mapped model. (0x3000) 
4

2 回答 2

1

一般来说,你需要git lfs install在你的系统上运行一次来​​设置过滤器命令,除非你的操作系统的打包已经完成了(例如 Git for Windows 和 Debian 的 git-lfs 包)。完成后,Git 将自动调用 Git LFS 来下载文件。

但是,这样做不会修复现有的存储库。您可以使用git lfs pull它来执行此操作,或者它会在您下次签出分支时自动完成。

请注意,如果您将您.gitconfig的文件保存在 dotfiles 存储库中,您将需要提交对git lfs install.gitconfig的 . 如果你这样做,你不需要git lfs install在任何安装了它的系统上运行.gitconfig

于 2021-07-23T00:22:38.700 回答
0

需要在 repo 上设置 git lfs:

git lfs install

然后:

git lfs pull
于 2021-07-22T21:05:59.883 回答