torvalds-dev / llama_index

LlamaIndex (formerly GPT Index) is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
0 stars 0 forks source link

[Feature Request]: Show stacktace for InstructorEmbedding import errors #21

Open torvalds-dev opened 7 months ago

torvalds-dev commented 7 months ago

Feature Description

The InstructorEmbedding will raise a custom ImportError if INSTRUCTOR module cannot be imported.

As a feature request, I propose to include the original error raised in the error message.

Reason

The error shown can be misleading, as pip install InstructorEmbedding does not install all required dependencies (see this https://github.com/xlang-ai/instructor-embedding/issues/7).

In my case, I had to install sentence_transformers manually after having installed INSTRUCTOR

Value of Feature

The current custom message may be misleading.

torvalds-dev commented 7 months ago

torvalds.dev is analyzing the ticket

torvalds-dev commented 7 months ago

The issue is about a feature request for the InstructorEmbedding module in the llama_index library

torvalds-dev commented 7 months ago

torvalds.dev is analyzing the ticket

torvalds-dev commented 7 months ago

The issue is about a feature request for the InstructorEmbedding module in the llama_index package. The InstructorEmbedding module raises a custom ImportError if the INSTRUCTOR module cannot be imported. The user is requesting that the original error raised be included in the error message.

The reason for this request is that the error message can be misleading. The pip install InstructorEmbedding command does not install all required dependencies. In the user's case, they had to manually install sentence_transformers after having installed INSTRUCTOR.

The value of this feature is to provide a more accurate error message to the user, helping them understand what might be going wrong when they try to import the INSTRUCTOR module.

The relevant file to this issue is llama_index/embeddings/huggingface.py. This file contains the InstructorEmbedding module that is raising the custom ImportError.

The actions that should be taken to resolve this issue are:

  1. Modify the InstructorEmbedding module to catch the original error when trying to import the INSTRUCTOR module.
  2. Include the original error message in the custom ImportError that is raised.
  3. Test the changes to ensure that the original error message is now included in the custom ImportError.
  4. Update any documentation or user guides to reflect this change in error messaging.