Second request never completes #62

Open
opened 2026-02-15 16:27:48 -05:00 by yindo · 0 comments
Owner

Originally created by @machinewrapped on GitHub (Apr 1, 2024).

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.

Originally created by @machinewrapped on GitHub (Apr 1, 2024). I tried integrating Ollama into [GPT-Subtrans](https://github.com/machinewrapped/gpt-subtrans/tree/ollama-support) 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#62