loading bar customizations

This commit is contained in:
Bruce MacDonald 2023-06-28 16:04:53 -04:00
parent 99ad4d0c9c
commit 8be9071ef5
2 changed files with 4 additions and 2 deletions

View file

@ -34,7 +34,7 @@ pip install -e .
``` ```
% ollama run huggingface.co/TheBloke/orca_mini_3B-GGML % ollama run huggingface.co/TheBloke/orca_mini_3B-GGML
Pulling huggingface.co/TheBloke/orca_mini_3B-GGML... Pulling huggingface.co/TheBloke/orca_mini_3B-GGML...
Downloading [================> ] 66.67% (2/3) 30.2MB/s Downloading [================ ] 66.67% 11.8MiB/s
... ...
... ...

View file

@ -38,7 +38,7 @@ def pull(remote, models_home=".", *args, **kwargs):
) )
) )
print(f"Fetching model from {new_url}") print(f"Pulling {parts.netloc}/{model}...")
response = requests.get(new_url) response = requests.get(new_url)
response.raise_for_status() # Raises stored HTTPError, if one occurred response.raise_for_status() # Raises stored HTTPError, if one occurred
@ -81,6 +81,8 @@ def pull(remote, models_home=".", *args, **kwargs):
unit_scale=True, unit_scale=True,
unit_divisor=1024, unit_divisor=1024,
initial=first_byte, initial=first_byte,
ascii=" ==",
bar_format="Downloading [{bar}] {percentage:3.2f}% {rate_fmt}{postfix}",
) as bar: ) as bar:
for data in response.iter_content(chunk_size=1024): for data in response.iter_content(chunk_size=1024):
size = file.write(data) size = file.write(data)