-
Notifications
You must be signed in to change notification settings - Fork 143
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
Use PromptTemplate for custom HuggingFace model #322
Comments
It loads the model in iteractive mode
I see some documentation in the README https://github.com/EricLBuehler/mistral.rs/blob/master/docs/CHAT_TOK.md about chat_templates, but it seems to be missing the examples https://github.com/EricLBuehler/mistral.rs/blob/master/docs/chat_templates. Can you provide some examples of Chat Templates that can be used? For the HF gguf model, that I'm using, this is the suggested PromptTemplate for json mode:
|
Hi @joshpopelka20! #327 added some docs and fixed the broken link. As you can see in this file: https://github.com/EricLBuehler/mistral.rs/blob/master/chat_templates/chatml.json, all you need to do is specify the full chat template (given inputs messages, add_generation_prompt, bos_token, eos_token, and unk_token), and pass that file path:
|
Excellent! I'll test this out. In the meantime, I found a workaround using ChatCompletionRequest:
Hope this helps the next dev looking into something similar. Also, thanks for working on this open-source project, I was able to get an approx. 90% improvement in response time. Looking forward to more optimizations to decrease the response time further. |
I'm trying to use a HF hub model that allows for function calling. From the docs, it seems as long as you have an access_token, you can use an HF model. This is the code for the model I want to use:
I want to pass a custom Prompt (or Prompt Template) using the Prompt that the model uses for json mode.
This is the code that I've tried, but it just seems to hang:
Any idea on how to send a custom Prompt?
The text was updated successfully, but these errors were encountered: