replicate / replicate-python

Python client for Replicate
https://replicate.com
Apache License 2.0
771 stars 222 forks source link

ReadTimeout when trying to perform prediction #395

Closed shivvor2 closed 3 weeks ago

shivvor2 commented 3 weeks ago

https://github.com/replicate/replicate-python/issues/135#issuecomment-2018529395 recommends users to provide large files via a link.

So, I hosted my own http server, port forwarded it with ngrok and got the required files accessable via a link. The server is configured in a way such that it basically never times out. (root directory of the server, containing a link to the file) image

I then passed in the link to perform a prediction via Client.run (usage shown below), which caused this issue (error logs attached to post).

Essentially I am doing this

default_timeout = httpx.Timeout(
        10080.0,      # default timeout
        read=10080.0,  # 3 hour minutes read timeout
        write=600.0,  # write timeout
        connect=600.0,  # connect timeout
        pool=600.0     # pool timeout
    )

client = replicate.Client(timeout = default_timeout)

client.run(model, input = input)

resulting in the following error

message.txt

other logs:

INFO:summarize_media.host_files.localhost:Local server starting at http://localhost:8000
INFO:ngrok.session:Session created with auth token
INFO:ngrok.listener:Created listener "aad2e8cf59ef69bafb3fac7eba556f6c" with url "https://42d6-203-218-60-205.ngrok-free.app"
INFO:summarize_media.host_files.localhost:Ngrok tunnel established at https://42d6-203-218-60-205.ngrok-free.app
INFO:ngrok.listener:Listener "aad2e8cf59ef69bafb3fac7eba556f6c" forwarding to "tcp://localhost:8000"
INFO:ngrok.tunnel_ext:forward_tunnel; tunnel_id="aad2e8cf59ef69bafb3fac7eba556f6c" url=tcp://localhost:8000
INFO:summarize_media.host_files.localhost:Hosted file Samo Burja on Sam Altman, Elon Musk, Peter Thiel, and George Soros.wav at https://42d6-203-218-60-205.ngrok-free.app/0a7a5b76-26ad-4f73-a592-b7f39cd09c49_Samo Burja on Sam Altman, Elon Musk, Peter Thiel, and George Soros.wav
Audio hosting at https://42d6-203-218-60-205.ngrok-free.app/0a7a5b76-26ad-4f73-a592-b7f39cd09c49_Samo Burja on Sam Altman, Elon Musk, Peter Thiel, and George Soros.wav, transcribing...
INFO:summarize_media.host_files.localhost:"GET / HTTP/1.1" 200 -
INFO:summarize_media.host_files.localhost:Removed hosted file Samo Burja on Sam Altman, Elon Musk, Peter Thiel, and George Soros.wav
shivvor2 commented 3 weeks ago

Solved, its a ngrok issue not a replicate issue, closing the issue