Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digest mismatch when executing 'create()' #63

Open
anastasiya1155 opened this issue Mar 6, 2024 · 2 comments
Open

digest mismatch when executing 'create()' #63

anastasiya1155 opened this issue Mar 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@anastasiya1155
Copy link

I have a consistent error when creating a new model based on my local gguf file. This error only happens when creating a first model, i.e. if there are any already loaded models in ollama this does not reproduce. Also, when running this command using ollama cli there is no error, only when using this library. Maybe I am missing some previous steps?
Here is my code:

const response = await ollama.create({
	model: 'my-model', modelfile: `FROM ${modelPath}`
});

where modelPath is an absolute path to GGUF file on my machine. This same command works ok with ollama CLI.
Response:

Failed to parse error response as JSON
ResponseError: digest mismatch, expected "sha256:06227ae08c77f2f6c8b16931c88510498cbc3c2a0acbb85e62186d614efb3737", got "sha256:9b3e16499cb74ed9e4824383fc96e014028d53e5679b68d4334bbb9df55afd57"
    at file:///Users/<my_path>/node_modules/ollama/dist/utils.js:58:15
    at Generator.next (<anonymous>)
    at fulfilled (file:///Users/<my_path>/node_modules/ollama/dist/utils.js:4:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  error: 'digest mismatch, expected "sha256:06227ae08c77f2f6c8b16931c88510498cbc3c2a0acbb85e62186d614efb3737", got "sha256:9b3e16499cb74ed9e4824383fc96e014028d53e5679b68d4334bbb9df55afd57"',
  status_code: 400
}

Steps to reproduce:

  1. Install and run ollama
  2. Make sure there are no models loaded by running ollama list (important)
  3. Create a new ollama model by using this library create() method
@BruceMacD BruceMacD self-assigned this Apr 24, 2024
@BruceMacD BruceMacD added the bug Something isn't working label Apr 24, 2024
@YozoraWolf
Copy link

            const response = await ollama.create({
                model: Core.model_name,
                modelfile: Core.modelfile,
            });

Same here.

ResponseError: digest mismatch, expected "sha256:c2ca99d853de276fb25a13e369a0db2fd3782eff8d28973404ffa5ffca0b9267", got "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a"

I only get this while using the ollama package, POST-ing to the API works good though.

sha256 is absolutely the same:

wolf@wolf-mint:/usr/share/ollama/.ollama/models/okuu$ sha256sum Meta-Llama-3-8B-Instruct.Q6_K.gguf 
c2ca99d853de276fb25a13e369a0db2fd3782eff8d28973404ffa5ffca0b9267  Meta-Llama-3-8B-Instruct.Q6_K.gguf

@BruceMacD
Copy link
Collaborator

Hey all, an update here. This is a bug in the ollama-js library. The problem stems from this bit of code that attempts to open a stream to upload the file:
https://github.com/ollama/ollama-js/blob/main/src/index.ts#L93

It's getting closed early so the checksum isn't correct. I'm still working on this, but if anyone has any ideas of a good fix please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants