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

Update URL to download pickle file #4

Open
jhbravo opened this issue Nov 28, 2024 · 1 comment
Open

Update URL to download pickle file #4

jhbravo opened this issue Nov 28, 2024 · 1 comment

Comments

@jhbravo
Copy link

jhbravo commented Nov 28, 2024

Modify the URL for downloading the pickle in the "ai_models_aurora/model.py" file

this line
download_url = "https://huggingface.co/microsoft/aurora/resolve/main/{file}"

for this other one
download_url = "https://huggingface.co/microsoft/aurora/blob/main/{file}"

@rodrigoalmeida94
Copy link

Can confirm this allows the download of the assets. With the current package I get this error:

$ ai-models --download-assets aurora-2.5-finetuned
2025-02-07 15:59:34,047 INFO Writing results to aurora-2.5-finetuned.grib
2025-02-07 15:59:34,048 INFO Downloading /home/fe/matosalmeida/uq/models/aurora-0.25-static.pickle
2025-02-07 15:59:34,048 INFO Downloading https://huggingface.co/microsoft/aurora/resolve/main/aurora-0.25-static.pickle
2025-02-07 15:59:34,439 INFO Total time: 2 seconds.
Traceback (most recent call last):
  File "/home/fe/matosalmeida/uq/.venv/bin/ai-models", line 10, in <module>
    sys.exit(main())
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/__main__.py", line 362, in main
    _main(sys.argv[1:])
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/__main__.py", line 310, in _main
    run(vars(args), unknownargs)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/__main__.py", line 319, in run
    model = load_model(cfg["model"], **cfg, model_args=model_args)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/model.py", line 611, in load_model
    return available_models()[name].load()(**kwargs)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/model.py", line 98, in __init__
    self.download_assets(**kwargs)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/ai_models/model.py", line 174, in download_assets
    download(self.download_url.format(file=file), asset + ".download")
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/multiurl/downloader.py", line 111, in download
    return Downloader(url, **kwargs).download(target)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/multiurl/base.py", line 123, in download
    with self.progress_bar(
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/multiurl/base.py", line 49, in progress_bar
    return tqdm(
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/asyncio.py", line 24, in __init__
    super().__init__(iterable, *args, **kwargs)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1098, in __init__
    self.refresh(lock_args=self.lock_args)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1347, in refresh
    self.display()
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1495, in display
    self.sp(self.__str__() if msg is None else msg)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1151, in __str__
    return self.format_meter(**self.format_dict)
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 585, in format_meter
    l_bar = prefix if bool_prefix_colon_already else prefix + ": "
TypeError: can only concatenate tuple (not "str") to tuple
Exception ignored in: <function tqdm.__del__ at 0x7f0d539a5090>
Traceback (most recent call last):
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1148, in __del__
    self.close()
  File "/home/fe/matosalmeida/uq/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1277, in close
    if self.last_print_t < self.start_t + self.delay:
AttributeError: 'tqdm_asyncio' object has no attribute 'last_print_t'

Changing the URL allows using the weights from hugging face.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants