【问题标题】:File path to Git LFS file on Github returns pointer to file, not actual binaryGithub 上 Git LFS 文件的文件路径返回指向文件的指针,而不是实际的二进制文件
【发布时间】:2021-09-30 01:56:28
【问题描述】:

所以,我在网上阅读了无数关于 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) 

【问题讨论】:

    标签: javascript git git-lfs mozilla-deepspeech


    【解决方案1】:

    需要在 repo 上设置 git lfs:

    git lfs install
    

    然后:

    git lfs pull
    

    【讨论】:

      【解决方案2】:

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

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

      请注意,如果您将 .gitconfig 保存在 dotfiles 存储库中,您将需要提交 git lfs install 对您的 .gitconfig 所做的更改,或者下次覆盖它时,您最终会返回在这个情况下。如果这样做,您不需要在安装了.gitconfig 的任何系统上运行git lfs install

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-11
        • 1970-01-01
        相关资源
        最近更新 更多