网页
综合
更新时间 2026-11-14 10:05:27
GptOssCausalLMPreprocessor layer
自动蜘蛛
keras.io
正文约 1188 字
GptOss Causal LM preprocessor.
This preprocessing layer is meant for use with keras_hub.models.GptOssCausalLM. By default, it will take in batches of strings, and return outputs in a (x, y, sample_weight) format, where the y label is the next token id in the x sequence.
For use with generation, the layer also exposes two methods generate_preprocess() and generate_postprocess(). When this preprocessor is attached to a keras_hub.models.GptOssCausalLM instance, these methods will be called implicitly in generate(). They can also be called standalone (e.g. to precompute preprocessing inputs for generation in a separate process).
Instantiate a keras_hub.models.Preprocessor from a model preset.
A preset is a directory of configs, weights and other file assets used to save and load a pre-trained model. The preset can be passed as one of:
For any Preprocessor subclass, you can run cls.presets.keys() to list all built-in presets available on the class.
As there are usually multiple preprocessing classes for a given model, this method should be called on a specific subclass like keras_hub.models.BertTextClassifierPreprocessor.from_preset().
The tokenizer used to tokenize strings.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。