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

[Community] [Text Splitters]: Fix TEI support and html section splitter #22595

Closed
wants to merge 0 commits into from

Conversation

plageon
Copy link
Contributor

@plageon plageon commented Jun 6, 2024

[Community]: Fix HuggingFaceHubEmbeddings
Modified langchain_community.embeddings.HuggingFaceHubEmbeddings, where the API call function does not match current Text Embeddings Inference API.
One example is:

{
  "inputs": "string",
  "normalize": true,
  "truncate": false
}

Parameters in _model_kwargs are not passed properly in the latest version. By the way, the issue why cause 413? #50 might be solved.

[Text Splitters]: Fix HTMLSectionSplitter
Modified langchain_text_splitters.HTMLSectionSplitter, where in the latest version dict data structure is used to store sections from a html document, in function split_html_by_headers. The header/section element names serve as dict keys. This can be a problem when duplicate header/section element names are present in a single html document. Latter ones can replace former ones with the same name. Therefore some contents can be miss after html text splitting is conducted.

Using a list to store sections can hopefully solve the problem.

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2024 9:34am

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Ɑ: embeddings Related to text embedding models module Ɑ: text splitters Related to text splitters package 🔌: huggingface Primarily related to HuggingFace integrations 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jun 6, 2024
@plageon plageon changed the title Fix TEI support and html section splitter [Community] [Text Splitters]: Fix TEI support and html section splitter Jun 6, 2024
@plageon plageon closed this Jun 7, 2024
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 7, 2024
efriis pushed a commit that referenced this pull request Jul 3, 2024
Update former pull request:
#22595.

Modified
`libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py`,
where the API call function does not match current [Text Embeddings
Inference
API](https://huggingface.github.io/text-embeddings-inference/#/Text%20Embeddings%20Inference/embed).
One example is:
```json
{
  "inputs": "string",
  "normalize": true,
  "truncate": false
}
```
Parameters in `_model_kwargs` are not passed properly in the latest
version. By the way, the issue *[why cause 413?
#50](huggingface/text-embeddings-inference#50
might be solved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: embeddings Related to text embedding models module 🔌: huggingface Primarily related to HuggingFace integrations size:XS This PR changes 0-9 lines, ignoring generated files. Ɑ: text splitters Related to text splitters package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants