Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase timeout for slow internet users #242

Open
BindingOx opened this issue Aug 10, 2024 · 10 comments
Open

increase timeout for slow internet users #242

BindingOx opened this issue Aug 10, 2024 · 10 comments
Labels
bug confirmed repository owner use only bug fixed repository owner use only

Comments

@BindingOx
Copy link

I kept getting the error message:

Attempt 1 of 5: Installing https://download.pytorch.org/whl/cu121/torch-2.2.2%2Bcu121-cp311-cp311-win_amd64.whl#sha256=efbcfdd4399197d06b32f7c0e1711c615188cdd65427b933648c7478fb880b3f
Running command: uv pip install https://download.pytorch.org/whl/cu121/torch-2.2.2%2Bcu121-cp311-cp311-win_amd64.whl#sha256=efbcfdd4399197d06b32f7c0e1711c615188cdd65427b933648c7478fb880b3f
Traceback (most recent call last):
  File "C:\Development\Repositories\VectorDB-Plugin-for-LM-Studio-6.5.0\src\setup_windows.py", line 370, in <module>
    priority_failed, priority_multiple = install_libraries(priority_libraries)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Development\Repositories\VectorDB-Plugin-for-LM-Studio-6.5.0\src\setup_windows.py", line 132, in install_libraries
    attempts = pip_install_with_retry(library)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Development\Repositories\VectorDB-Plugin-for-LM-Studio-6.5.0\src\setup_windows.py", line 114, in pip_install_with_retry
    result = subprocess.run(pip_args, check=True, capture_output=True, text=True, timeout=180)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\users\admin\appdata\local\programs\python\python311\Lib\subprocess.py", line 550, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\users\admin\appdata\local\programs\python\python311\Lib\subprocess.py", line 1209, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\users\admin\appdata\local\programs\python\python311\Lib\subprocess.py", line 1630, in _communicate
    raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command '['uv', 'pip', 'install', 'https://download.pytorch.org/whl/cu121/torch-2.2.2%2Bcu121-cp311-cp311-win_amd64.whl#sha256=efbcfdd4399197d06b32f7c0e1711c615188cdd65427b933648c7478fb880b3f']' timed out after 180 seconds

until I changed all timeout in setup_windows.py script to timeout=300 (5 minutes) or even timeout=600 (10 minutes)

@BBC-Esq
Copy link
Owner

BBC-Esq commented Aug 11, 2024

Did it eventually work? Sometimes PyTorch's servers are down for an upgrade.

@BBC-Esq
Copy link
Owner

BBC-Esq commented Aug 11, 2024

I doublechecked and the timeout does occur if the download doesn't occur in the specified time, not merely if it hasn't started in the allotted time, which was my original intention. I'll fix this in the next patch release.

@BBC-Esq BBC-Esq added the bug confirmed repository owner use only label Aug 11, 2024
@BindingOx
Copy link
Author

Yes it eventually finished. I was able to download pytorch directly from the link so not sure if the servers were down. I tried like 3 or 4 times using the script but it didn't work until I increased the timeout.

@BBC-Esq
Copy link
Owner

BBC-Esq commented Aug 11, 2024

Increased the timeout to 240 seconds.

@BBC-Esq BBC-Esq added the bug fixed repository owner use only label Aug 12, 2024
@BBC-Esq BBC-Esq closed this as completed Aug 12, 2024
@DmytroSokhach
Copy link

Had to increase the time to like 1500 sec 😁✌️
Total installation time: 00:24:24.48

@BBC-Esq
Copy link
Owner

BBC-Esq commented Dec 4, 2024

Oh damn...so was your Internet slow or just a lower end laptop or something with fewer cores?

@BBC-Esq BBC-Esq reopened this Dec 4, 2024
@BBC-Esq
Copy link
Owner

BBC-Esq commented Dec 4, 2024

Re-opening the issue so others can see it if they encounter it.

@DmytroSokhach
Copy link

WOW! Impressed by your responsiveness.
That "uv.exe" command I see for the 1st time used for download. And I wonder if it possible to not use timeout at all?
Is it possible to fallback to timeout only if there is no download activity happening?

@BBC-Esq
Copy link
Owner

BBC-Esq commented Dec 5, 2024

I like that suggestion actually, and will incorporate it into a future release...but I'm thinking of perhaps adding a function to monitor the download speeds and set a threshold download rate instead...

For example, if the "average" download speed is less than 1 MB/second for X seconds, then the timeout will occur. That way, as long as it's downloading at the bare minimum speed on "average," the timeout will not occur...and if the "average" falls below the X threshhold for the specified duration, it'll eventually terminate early...That way it'll return the command prompt. Would that help?

@DmytroSokhach
Copy link

I would set it to 100 KB/second actually.
On my yesterday's example I didn't even know it is so slow, cause in other room another PC was downloading Steam game 🎮 at max speed around 4-5 MB/s on average, and when I started download it was around 100-200KB/s occasionally going to 3-4MB/s.

So speed limit IMHO is not what needed in case above, but rather "CASE WHEN speed is 0 for 30-60 sec, THEN interrupt".
This is definitely situation when "no connection" exist, and script should stop.

Speed limit I needed later on when my wife started watching online movie, and I started the script which consumed max 4-5 MB/s and broke movie session for my wife 🙃
For that 2nd scenario speed limit sounds good, but if I were you I would ignore this case because it will differ from user to user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed repository owner use only bug fixed repository owner use only
Projects
None yet
Development

No branches or pull requests

3 participants