Skip to content

Can I do SFT with dataset that includes tool usage with TorchTune? #1921

Answered by RdoubleA
albertbou92 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, tool-calling is supported in SFT as long as the model tokenizer you are using supports it. A tool call would be Message(role="assistant", ipython=True) and the return from the tool call would be Message(role="ipython")

You will just need to ensure that your dataset gets translated to Messages correctly. You may need to make a custom message transform, using the torchtune.data.OpenAIToMessages as a starting point. We might need to update that class to ensure tool calls and tool returns are converted correctly, so please let us know if you have any trouble with this.

I've been meaning to add a dataset example with tool calls and tool returns but haven't gotten a chance to. What dataset…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@albertbou92
Comment options

@RdoubleA
Comment options

@albertbou92
Comment options

@RdoubleA
Comment options

Answer selected by albertbou92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants