ollama / ollama/ollama-python

Second request never completes

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I tried integrating Ollama into GPT-Subtrans this weekend.

It launches ollama in a subprocess and makes a series of requests to translate subtitles in batches. The first request works, but it hangs on the second request.

DEBUG - send_request_headers.started request=<Request [b'POST']>
DEBUG - send_request_headers.complete
DEBUG - send_request_body.started request=<Request [b'POST']>
DEBUG - send_request_body.complete
DEBUG - receive_response_headers.started request=<Request [b'POST']>
... hangs here, never receives response

I put together a test script which shows the same behaviour:
https://github.com/machinewrapped/Bugs/blob/master/OllamaTest/ollama_test.py

Is there something I need to do between requests to prepare the server? It doesn't seem to matter whether I use generate or chat, the result is the same.

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.

Research direction

Start by running the linked OllamaTest/ollama_test.py script and inspect how it launches Ollama and sends consecutive requests. Compare the first and second generate or chat calls, then verify that the second request receives a response without requiring an extra preparation step.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.