5 instantiations of CausalLMModelInput
Microsoft.ML.GenAI.Core (5)
Pipeline\CausalLMPipeline.cs (3)
146var input = new CausalLMModelInput(inputIds, attentionMask, pastKeyValuesLength: 0) 155var input = new CausalLMModelInput(inputIds[.., prevPos..curPos], attentionMask[.., prevPos..curPos], pastKeyValuesLength: prevPos) 311var input = new CausalLMModelInput(inputTensor, attentionMask, pastKeyValuesLength: 0)
Trainer\CasualLMSupervisedFineTuningTrainer.cs (1)
58var output = _pipeline.Model.forward(new CausalLMModelInput(inputIds, attentionMask: attentionMask, labels: labels, useCache: false));
Trainer\CausalLMDataset.cs (1)
93return new CausalLMModelInput(
28 references to CausalLMModelInput
Microsoft.ML.GenAI.Core (13)
CausalLMPipelineChatClient.cs (1)
19where TCausalLMModel : nn.Module<CausalLMModelInput, CausalLMModelOutput>
Pipeline\CausalLMPipeline.cs (8)
19where TModel : nn.Module<CausalLMModelInput, CausalLMModelOutput> 30nn.Module<CausalLMModelInput, CausalLMModelOutput> Model { get; } 70where TModel : nn.Module<CausalLMModelInput, CausalLMModelOutput> 98nn.Module<CausalLMModelInput, CausalLMModelOutput> model, 118public nn.Module<CausalLMModelInput, CausalLMModelOutput> Model { get; } 146var input = new CausalLMModelInput(inputIds, attentionMask, pastKeyValuesLength: 0) 155var input = new CausalLMModelInput(inputIds[.., prevPos..curPos], attentionMask[.., prevPos..curPos], pastKeyValuesLength: prevPos) 311var input = new CausalLMModelInput(inputTensor, attentionMask, pastKeyValuesLength: 0)
Trainer\CausalLMDataset.cs (4)
17public class CausalLMDataset : IEnumerable<CausalLMModelInput> 19private readonly List<CausalLMModelInput> _data; 21private CausalLMDataset(IEnumerable<CausalLMModelInput> data) 23_data = new List<CausalLMModelInput>(data);
Microsoft.ML.GenAI.Core.Tests (1)
CasualLMDatasetTest.cs (1)
72foreach (var item in dataset)
Microsoft.ML.GenAI.LLaMA (4)
LlamaForCausalLM.cs (2)
17public class LlamaForCausalLM : nn.Module<CausalLMModelInput, CausalLMModelOutput> 60public override CausalLMModelOutput forward(CausalLMModelInput input)
Module\LlamaModel.cs (2)
12internal class LlamaModel : nn.Module<CausalLMModelInput, CausalLMModelOutput> 53public override CausalLMModelOutput forward(CausalLMModelInput input)
Microsoft.ML.GenAI.Mistral (4)
MistralForCausalLM.cs (2)
16public class MistralForCausalLM : nn.Module<CausalLMModelInput, CausalLMModelOutput> 39public override CausalLMModelOutput forward(CausalLMModelInput input)
MistralModel.cs (2)
12public class MistralModel : nn.Module<CausalLMModelInput, CausalLMModelOutput> 51public override CausalLMModelOutput forward(CausalLMModelInput input)
Microsoft.ML.GenAI.Phi (6)
Module\Phi3Model.cs (2)
13internal class Phi3Model : nn.Module<CausalLMModelInput, CausalLMModelOutput> 54public override CausalLMModelOutput forward(CausalLMModelInput input)
Phi2\Phi2ForCasualLM.cs (2)
17public class Phi2ForCasualLM : nn.Module<CausalLMModelInput, CausalLMModelOutput> 33public override CausalLMModelOutput forward(CausalLMModelInput input) // use_cache, output_attentions, output_hidden_states
Phi3\Phi3ForCasualLM.cs (2)
21public class Phi3ForCasualLM : nn.Module<CausalLMModelInput, CausalLMModelOutput> 41public override CausalLMModelOutput forward(CausalLMModelInput input)