Causal language model pipeline? #1340
GeorgeS2019
started this conversation in
General
Replies: 1 comment 2 replies
-
Hey @GeorgeS2019 nice to meet you For the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wonder if this discussion here is also relevant for TorchSharp?
Could this be part of TorchText?
@LittleLittleCloud
Add GenAI packages
src/Microsoft.ML.GenAI.Core/Extension/CausalLMPipelineExtension.cs
What is a causal language model pipeline?
The causal language model pipeline is a utility class which wraps a tokenizer and a causal language model and provides a uniformed interface for various decoding method to generate text. The pipeline is designed to be easy to use and requires only a few lines of code to generate text.
In Microsoft.ML.GenAI, we will provide a generic
CausalLMPipeline
class plus a typedCausalLMPipeline
class which specifies the type parameters for the tokenizer and the causal language model. The typedCausalLMPipeline
class make it easier to develop consuming method for semantic kernel. see here for more detailsContract
Usage
Sampling methods
The
CausalLMPipeline
provides a uniformed interface for various decoding methods to generate text. This saves our effort to implement different decoding methods for each model.Sampling
Note
The Greedy search and beam search are not implemented in the pipeline yet. They will be added in the future.
Greedy Search
Beam Search
I
The extension method for
CausalLMPipeline
The extension
Generate
method provides a even-easier way to generate text without the necessary to generate the input tensor. The method takes a prompt string and other optional parameters to generate text.Beta Was this translation helpful? Give feedback.
All reactions