replicate/replicate-python

Python client meet replicate.exceptions.ModelError when input video from a flask site on vps

wwfem opened this issue · 1 comments

video from a flask site on vps, the url can be visited by browsers, but replicate failed.

Anyone can help how to do? Thanks

url = 'https://xxx/static/videos/z1.webm'

replicate_demo.py as
output = replicate.run(
"sanzgiri/cartoonify_video:11095c67166f44781a9274969e75bae32ef7896bc17cb5d95732aa63e7d1b86e",
input={
"infile": url,
"frame_rate": fps,
"horizontal_resolution": 480
}
)
print(output)

Traceback (most recent call last):
File "/home/replicatePythonDirectly/cartoonify_video/mainMult.py", line 26, in
output = replicate.run(
File "/usr/local/lib/python3.9/dist-packages/replicate/client.py", line 147, in run
return run(self, ref, input, **params)
File "/usr/local/lib/python3.9/dist-packages/replicate/run.py", line 52, in run
raise ModelError(prediction.error)
replicate.exceptions.ModelError: HTTPSConnectionPool(host='xxx', port=443): Max retries exceeded with url: /static/videos/z1.webm (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7aba61e7d350>: Failed to establish a new connection: [Errno 111] Connection refused'))

Hi @wwfem. It looks like the model is having trouble connecting to the provided URL. This is a problem with the model itself, and the Replicate client is reporting that error. I can't help you debug that error, but I'd suggest starting by trying to load that URL using urllib3 to see if you can reproduce the error in isolation.