1 write to Labels
Microsoft.ML.GenAI.Core (1)
Pipeline\CausalLMModelInput.cs (1)
41this.Labels = labels;
7 references to Labels
Microsoft.ML.GenAI.Core (2)
Trainer\CasualLMSupervisedFineTuningTrainer.cs (2)
56var labels = torch.cat(batch.Select(x => nn.functional.pad(x.Labels!, [0, maxLen - x.Labels!.shape[1]], value: -100)).ToArray(), 0).to(device);
Microsoft.ML.GenAI.Core.Tests (3)
CasualLMDatasetTest.cs (3)
47dataset[0].Labels!.data<long>().Should().BeEquivalentTo([-100, -100, -100, -100, 6]); 50dataset[^1].Labels!.data<long>().Should().BeEquivalentTo([-100, -100, -100, -100, -100, -100, -100, -100, 10]); 74item.Labels!.shape.Should().BeEquivalentTo(item.InputIds!.shape);
Microsoft.ML.GenAI.LLaMA (2)
LlamaForCausalLM.cs (2)
69if (input.Labels is not null) 75var shiftLabels = input.Labels[.., ..].contiguous();