PromptTemplateTransformer
Namespace: LLama.Transformers
A prompt formatter that will use llama.cpp's template formatter If your model is not supported, you will need to define your own formatter according the cchat prompt specification for your model
1 |
|
Inheritance Object → PromptTemplateTransformer
Implements IHistoryTransform
Attributes NullableContextAttribute, NullableAttribute
Constructors
PromptTemplateTransformer(LLamaWeights, Boolean)
A prompt formatter that will use llama.cpp's template formatter If your model is not supported, you will need to define your own formatter according the cchat prompt specification for your model
1 |
|
Parameters
model
LLamaWeights
withAssistant
Boolean
Methods
HistoryToText(ChatHistory)
1 |
|
Parameters
history
ChatHistory
Returns
TextToHistory(AuthorRole, String)
1 |
|
Parameters
role
AuthorRole
text
String
Returns
Clone()
1 |
|
Returns
ToModelPrompt(LLamaTemplate)
Apply the template to the messages and return the resulting prompt as a string
1 |
|
Parameters
template
LLamaTemplate
Returns
String
The formatted template string as defined by the model