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

[Bug]: cannot download RaptorPack via llamaindex-cli and download_llama_pack #11689

Closed
kun432 opened this issue Mar 6, 2024 · 3 comments · Fixed by #11699
Closed

[Bug]: cannot download RaptorPack via llamaindex-cli and download_llama_pack #11689

kun432 opened this issue Mar 6, 2024 · 3 comments · Fixed by #11699
Assignees
Labels
bug Something isn't working P0 Priority 0

Comments

@kun432
Copy link
Contributor

kun432 commented Mar 6, 2024

Bug Description

Trying RAPTOR notebook on Google Colab. I need to customize RaptorPack source and translate the summary prompt into Japanese. so, I want to download the pack, not installing via pip.

Tried via llamaindex-cli first.

!llamaindex-cli download-llamapack RaptorPack --download-dir ./raptor_pack

Also, tried via download_llama_pack.

from llama_index.core.llama_pack import download_llama_pack

RaptorPack = download_llama_pack("RaptorPack", "./raptor_pack", refresh_cache=False)

both failed. Please see logs below.

Version

llama-index-core-0.10.16.post1, llama-index-cli-0.1.7

Steps to Reproduce

!pip install llama-index

then

!llamaindex-cli download-llamapack RaptorPack --download-dir ./raptor_pack

or

from llama_index.core.llama_pack import download_llama_pack

RaptorPack = download_llama_pack("RaptorPack", "./raptor_pack", refresh_cache=False)

Relevant Logs/Tracbacks

Traceback (most recent call last):
  File "/usr/local/bin/llamaindex-cli", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/llama_index/cli/command_line.py", line 269, in main
    args.func(args)
  File "/usr/local/lib/python3.10/dist-packages/llama_index/cli/command_line.py", line 180, in <lambda>
    func=lambda args: handle_download_llama_pack(**vars(args))
  File "/usr/local/lib/python3.10/dist-packages/llama_index/cli/command_line.py", line 39, in handle_download_llama_pack
    download_llama_pack(
  File "/usr/local/lib/python3.10/dist-packages/llama_index/core/llama_pack/download.py", line 47, in download_llama_pack
    raise ValueError(f"Failed to find python package for class {llama_pack_class}")
ValueError: Failed to find python package for class RaptorPack
@kun432 kun432 added bug Something isn't working triage Issue needs to be triaged/prioritized labels Mar 6, 2024
Copy link

dosubot bot commented Mar 6, 2024

Hey @kun432, great to see you back! Running into new adventures with LlamaIndex, I see. Let's tackle this one together. 🚀

Thank you for providing detailed information about the issue you're facing. Based on the traceback you've shared, it seems like the download_llama_pack function is unable to find the RaptorPack class. This could be due to a few reasons:

  1. The RaptorPack class does not exist in the Llama Hub. Please ensure that the class name is spelled correctly and that it exists in the Llama Hub.

  2. There might be an issue with the llama_hub_url parameter. By default, it points to LLAMA_HUB_URL. If this URL is not accessible or does not contain the RaptorPack class, the function will fail.

  3. The download_llama_pack function checks if the downloaded class is a subclass of BaseLlamaPack. If RaptorPack is not a subclass of BaseLlamaPack, the function will raise a ValueError.

As for the llamaindex-cli download-llamapack command, it essentially wraps around the download_llama_pack function, so the same points apply.

I noticed that there was a similar issue in the past (Not able to use LLama Packs [Bug]: ), which was resolved by a pull request ([FIX] download_llama_pack for python packages containing multiple packs](#11272)). However, this fix was applied on February 22, 2024, and you're using llama-index-core-0.10.16.post1, which might not include this fix. Could you please confirm the date when you installed the llama-index-core package? If it was before February 22, 2024, I recommend updating the package and trying again.

If none of the above solutions work, could you please provide more information about the RaptorPack? Specifically, is it a subclass of BaseLlamaPack and does it exist in the Llama Hub at the LLAMA_HUB_URL? This information will help us diagnose the issue further.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@kun432
Copy link
Contributor Author

kun432 commented Mar 6, 2024

The RaptorPack class does not exist in the Llama Hub. Please ensure that the class name is spelled correctly and that it exists in the Llama Hub.

RaptorPack is here:
https://llamahub.ai/l/llama-packs/llama-index-packs-raptor
https://github.com/run-llama/llama_index/tree/main/llama-index-packs/llama-index-packs-raptor

The download_llama_pack function checks if the downloaded class is a subclass of BaseLlamaPack. If RaptorPack is not a subclass of BaseLlamaPack, the function will raise a ValueError.

RaptorPack is a subclass of BaseLlamaPack:
https://github.com/run-llama/llama_index/blob/main/llama-index-packs/llama-index-packs-raptor/llama_index/packs/raptor/base.py#L328

However, this fix was applied on February 22, 2024, and you're using llama-index-core-0.10.16.post1, which might not include this fix. Could you please confirm the date when you installed the llama-index-core package? If it was before February 22, 2024, I recommend updating the package and trying again.

seems v0.10.16 has been released 18 hours ago and I tested just before now. That fix should be included.
https://github.com/run-llama/llama_index/releases/tag/v0.10.16

@nerdai nerdai self-assigned this Mar 6, 2024
@nerdai nerdai added P0 Priority 0 and removed triage Issue needs to be triaged/prioritized labels Mar 6, 2024
@nerdai
Copy link
Contributor

nerdai commented Mar 6, 2024

Hi @kun432,

Sorry about the trouble with this. Unfortunately there is a reliance on mappings.json that acts as a registry for which download_llama_pack and cli installs depend on. This mappings.json has not been updated yet to include the new RAPTOR pack.

Will update and submit a fix very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Priority 0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants