Add HuggingFace support #245
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief Description of Changes
LangChain has a HuggingFace integration which works similarly to how the current
Chat[PROVIDER]object models work inagent/llm.pyand given that HuggingFace hosts a variety of custom models for prospective users, I figured it might be good to add considering there may be users who want to use models which may not be supported through other channels and who are more familiar with HuggingFace calls than the other Chat models.Additions
pip install langchain-huggingfaceadded intonew_software_v007.shllm.py:Sample Prompt
Note that the actual output isn't that great due to model selection, this is just to show functionality. For testing purposes, Mistral's Ollama and Bedrock compatibility were removed to ensure the model wasn't using those instead. I manually replaced triple tick with triple double quotes from the
<execute>blocks so they can be formatted nicely here: