marvin
marvin copied to clipboard
Enable Marvin to use HuggingFace models
First check
- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to look for a similar issue and didn't find it.
- [X] I searched the Marvin documentation for this feature.
Describe the current behavior
The current implementation requires an OpenAI account/key. OpenAI is doing an awesome job, but it can also be expensive. For some experiments/jobs it's enough to work with a slightly smaller model. HuggingFace hub contains a wealth of models that could be used (e.g. codegen
, google/flan-t5-xl
or gpt-j
) and HuggingFace is supported by langchain
so it shouldn't be too difficult to support this.
I know the README
says that other models aren't supported because prompts might not translate well, but shouldn't it be up to the user to figure out which model works best for their use case?
Describe the proposed behavior
- Set a HuggingFace API key
- Set a global config (something like
marvin.settings.backend = 'HUGGINGFACE'
) - Use
langchain
to load and use the model specified
Example Use
No response
Additional context
No response
@gijswobben I'm looking into this -- I was about to write that there was some difficulty because Langchain doesn't support huggingface via chat interface but ask and ye shall receive: https://twitter.com/LangChainAI/status/1657430519607623680
Will try to implement soon!
(I'm not sure if this really allows conversation and history the way we expect, especially because of system messages... we'll see)
This was implemented in Marvin 0.X.
Moving forward we'll support any bring-your-own-model, with OpenAI as a first class citizen.