Skip to navigation

Struct Generation Params

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct GenerationParams {
    pub temperature: Option<f64>,
    pub max_tokens: Option<u64>,
    pub top_p: Option<f64>,
    pub stop: Option<StringList>,
}

Portable generation controls with presence preserved for every optional value.

Fields

temperature: Option<f64>

Sampling temperature.

max_tokens: Option<u64>

Maximum number of tokens to generate.

top_p: Option<f64>

Nucleus sampling probability.

stop: Option<StringList>

Stop sequences.

Implementations

impl GenerationParams

impl GenerationParams

temperature

pub fn temperature(&self) -> f64

Returns the value of temperature, or the default value if temperature is unset.

max_tokens

pub fn max_tokens(&self) -> u64

Returns the value of max_tokens, or the default value if max_tokens is unset.

top_p

pub fn top_p(&self) -> f64

Returns the value of top_p, or the default value if top_p is unset.

Trait Implementations

impl Clone for GenerationParams

impl Clone for GenerationParams

clone

fn clone(&self) -> GenerationParams

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for GenerationParams

impl Debug for GenerationParams

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for GenerationParams

impl Default for GenerationParams

default

fn default() -> Self

impl Message for GenerationParams

impl Message for GenerationParams

encoded_len

fn encoded_len(&self) -> usize

clear

fn clear(&mut self)

encode

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
    Self: Sized,

encode_to_vec

fn encode_to_vec(&self) -> Vec<u8> where
    Self: Sized,

encode_length_delimited

fn encode_length_delimited(
    &self,
    buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
    Self: Sized,

encode_length_delimited_to_vec

fn encode_length_delimited_to_vec(&self) -> Vec<u8> where
    Self: Sized,

decode

fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
    Self: Default,

decode_length_delimited

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
    Self: Default,

merge

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
    Self: Sized,

merge_length_delimited

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
    Self: Sized,

impl Name for GenerationParams

impl Name for GenerationParams

NAME

const NAME: &'static str = "GenerationParams"

PACKAGE

const PACKAGE: &'static str = "nvidia.nemo.relay.worker.v1"

full_name

fn full_name() -> String

type_url

fn type_url() -> String

impl PartialEq for GenerationParams

impl PartialEq for GenerationParams

eq

fn eq(&self, other: &GenerationParams) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl WireValue<GenerationParams> for GenerationParams

impl WireValue<GenerationParams> for GenerationParams

to_wire

fn to_wire(self) -> Result<GenerationParams>

from_wire

fn from_wire(value: GenerationParams) -> Result<Self>

impl StructuralPartialEq for GenerationParams

impl StructuralPartialEq for GenerationParams