ollama / ollama/ollama-python

Error message is not helpful when the input to a model exceeds the limit.

Open
#355 1 comment 0 reactions 1 assignee View on GitHub

@ParthSareen is already working on this.

Since Dec 2, 2024.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

Context: I tried to send chunked texts to an embedding model using Ollama and got the following error:

.venv/lib/python3.12/site-packages/ollama/_client.py", line 120, in _request_raw
    raise ResponseError(e.response.text, e.response.status_code) from None
ollama._types.ResponseError: {}

It was not clear what happened and I had to check the failed batch of examples and examine what happened. Eventually I was able to figure out the reason is that the chunk limit is higher than the allowed input size, and thus the server returns error for such long inputs.

I'm wondering if it's possible to produce more helpful error message in such cases?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.