Skip to content
Snippets Groups Projects
Unverified Commit da157962 authored by James Braza's avatar James Braza Committed by GitHub
Browse files

Hugging Face Inference API (#8098)


* Added first pass of Hugging Face Inference API wrapper

* Added first pass of testing for HuggingFaceInferenceAPI

* Added support for message history in chat

* Added test_chat and fixed conversational_output_to_chat_response

* Added validate_supported function to check if a model is loaded

* Populated completion function using text_generation, with test

* Added CHANGELOG entry

* Added links to task pages on Hugging Face

* Added embedding capability to Hugging Face Inference API

* Added LLM and embedding to __init__/__all__, alphabetizing __all__

* Split up Hugging Face Inference API's embeddings to a subclass

* Moved Pooling to embeddings/utils.py

* Added sentence on TGI backend to class docstring

* Implemented LLMMetadata using pass-through Fields

* Added helper function to get ModelInfo

* Moved embed_documents to use 1+ single-text queries instead of 1 multiple-text query

* Fixed pydantic ForwardRef error in embeddings __init__.py

* Moved embeddings to use asyncio, and updated tests to match

* Added max new tokens to completion

* Comment tweaks when looking over the PR

* Removed conversational_output_to_chat_response helper since it's just indirection

* Moved pooling from embeddings/utils.py to embeddings/pooling.py

* Using langchain.bridge for Embeddings import

* Moved default pooling to CLS pooling

* Revert embeddings/utils.py

* Cleaned up conditionals within huggingface_utils

* Moved from LangChain Embeddings to LlamaIndex BaseEmbedding

* Expanded huggingface_utils formatting to allow None model_name

* Added test of embeddings serialization, to confirm mixin of BaseEmbeddings plays nice with pydantic

* clean doc

* minor update

---------

Co-authored-by: default avatarSimon Suo <simonsdsuo@gmail.com>
parent a04239f3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment