Skip to content

Instantly share code, notes, and snippets.

@magdesign
Created October 4, 2024 03:05
Show Gist options
  • Save magdesign/d645a32852d8569cdb19e0a4a032bcfe to your computer and use it in GitHub Desktop.
Save magdesign/d645a32852d8569cdb19e0a4a032bcfe to your computer and use it in GitHub Desktop.
$ uv run ollama_dl.py llama3.2
[10/03/24 23:56:50] INFO Downloading to:
library-llama3.2
[10/03/24 23:56:51] INFO Already have
library-llama3.2/params-56b
b8bd477a5.json
INFO Already have
library-llama3.2/template-9
66de95ca8a6.txt
INFO Already have
library-llama3.2/license-a7
0ff7e570d9.txt
INFO Already have
library-llama3.2/license-fc
c5a6bec9da.txt
library-llama3.2/model-dde5aa3fc5ff.gguf (1925 MB) 17%
Traceback (most recent call last):
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
yield
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 257, in __aiter__
async for part in self._httpcore_stream:
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 367, in __aiter__
raise exc from None
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 363, in __aiter__
async for part in self._stream:
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 349, in __aiter__
raise exc
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 341, in __aiter__
async for chunk in self._connection._receive_response_body(**kwargs):
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 210, in _receive_response_body
event = await self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 224, in
_receive_event
data = await self._network_stream.read(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 32, in read
with map_exceptions(exc_map):
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/me/Downloads/ollama-dl/ollama_dl.py", line 165, in <module>
main()
File "/home/me/Downloads/ollama-dl/ollama_dl.py", line 154, in main
asyncio.run(
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/me/Downloads/ollama-dl/ollama_dl.py", line 127, in download
await asyncio.gather(*tasks)
File "/home/me/Downloads/ollama-dl/ollama_dl.py", line 69, in download_blob
async for chunk in resp.aiter_bytes(1048576):
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_models.py", line 931, in aiter_bytes
async for raw_bytes in self.aiter_raw():
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_models.py", line 931, in aiter_bytes
async for raw_bytes in self.aiter_raw():
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_models.py", line 989, in aiter_raw
async for raw_stream_bytes in self.stream:
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_client.py", line 150, in __aiter__
async for chunk in self._stream:
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 256, in __aiter__
with map_httpcore_exceptions():
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/home/me/Downloads/ollama-dl/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment