12 references to RobertaModel
Microsoft.ML.TorchSharp (12)
Extensions\TokenizerExtensions.cs (1)
54return tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(tokenizer.EncodeToIds(sentence));
NasBert\NasBertTrainer.cs (2)
204EnglishRobertaTokenizer tokenizerModel = Tokenizer.RobertaModel(); 240return DataUtils.CollateTokens(inputTensors, Tokenizer.RobertaModel().PadIndex, device: Device);
NasBert\NerTrainer.cs (2)
190t = torch.tensor((ZeroArray).Concat(Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(encoding.Select(t => t.Id).ToArray())).ToList(), device: Device); 330EnglishRobertaTokenizer tokenizerModel = tokenizer.RobertaModel();
NasBert\SentenceSimilarityTrainer.cs (1)
242EnglishRobertaTokenizer tokenizerModel = tokenizer.RobertaModel();
NasBert\TextClassificationTrainer.cs (1)
266EnglishRobertaTokenizer tokenizerModel = tokenizer.RobertaModel();
Roberta\QATrainer.cs (5)
352srcTensor = PrepareBatchTensor(ref inputTensors, device: Device, Tokenizer.RobertaModel().PadIndex); 406var contextTokenId = Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(contextTokens.Select(t => t.Id).ToArray()); 857var contextTokenId = _parent.Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(_parent.Tokenizer.EncodeToIds(context.ToString())); 859var questionTokenId = _parent.Tokenizer.RobertaModel().ConvertIdsToOccurrenceRanks(_parent.Tokenizer.EncodeToIds(question.ToString())); 927outputCache.PredictedAnswersBuffer[index] = new ReadOnlyMemory<char>(_parent.Tokenizer.Decode(_parent.Tokenizer.RobertaModel().ConvertOccurrenceRanksToIds(contextIds).ToArray().AsSpan(predictStart - questionLength - 2, predictEnd - predictStart).ToArray()).Trim().ToCharArray());