huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
2.02k stars 531 forks source link

Input should be a valid dictionary or instance of SentenceSimilarityInputsCheck: received `Context information is below. #2227

Closed asma-10 closed 5 months ago

asma-10 commented 5 months ago

Describe the bug

hello everyone, i am using these 2 models like :

Settings.llm = HuggingFaceInferenceAPI(model_name="sentence-transformers/all-MiniLM-L6-v2", api_key=hf_token)
Settings.embed_model = HuggingFaceEmbedding(model_name='BAAI/bge-m3')

and i get this error every time i run the code :

BadRequestError: (Request ID: iSyblEXWumFZFNfAZERUT)

Bad request: Input should be a valid dictionary or instance of SentenceSimilarityInputsCheck: received `Context information is below.

Can someone help with this !

Reproduction

if not os.path.exists(persis_dir):
  documents = SimpleDirectoryReader('data').load_data()
  index = VectorStoreIndex.from_documents(documents)
  index.storage_context.persist(persist_dir=persis_dir)
else:
  storage_context = StorageContext.from_defaults(persist_dir=persis_dir)
  index = load_index_from_storage(storage_context=storage_context)

Logs

No response

System info

- huggingface_hub version: 0.20.3
- Platform: Linux-6.1.58+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /root/.cache/huggingface/token
- Has saved token ?: True
- Who am I ?: farazfarid
- Configured git credential helpers: 
- FastAI: 2.7.14
- Tensorflow: 2.15.0
- Torch: 2.2.1+cu121
- Jinja2: 3.1.3
- Graphviz: 0.20.3
- Pydot: 1.4.2
- Pillow: 9.4.0
- hf_transfer: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: 1.25.2
- pydantic: 2.6.4
- aiohttp: 3.9.3
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /root/.cache/huggingface/hub
- HF_ASSETS_CACHE: /root/.cache/huggingface/assets
- HF_TOKEN_PATH: /root/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
Wauplin commented 5 months ago

Hi @asma-10, which library are you using? This doesn't look like an error in the huggingface_hub library. Could you report your bug to the correct repo instead? (LlamaIndex I assume?).

asma-10 commented 5 months ago

hi @Wauplin thanks for your response, oh okey, as long as it is not a hugging_face error i will report this bug in llamaindex they may have a solution right there

Thanks again