pub struct RuntimeConfig {
pub max_context_length: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<u32>,
pub max_tokens: Option<u32>,
pub stop_sequences: Vec<String>,
pub batch_size: Option<u32>,
pub max_concurrent_requests: Option<u32>,
pub gpu_device_ids: Vec<u32>,
pub memory_limit_mb: Option<u64>,
pub enable_streaming: bool,
pub custom_params: HashMap<String, Value>,
}Expand description
模型运行时配置
Fields§
§max_context_length: Option<u32>最大上下文长度
temperature: Option<f32>温度参数
top_p: Option<f32>Top-p 参数
top_k: Option<u32>Top-k 参数
max_tokens: Option<u32>最大生成长度
stop_sequences: Vec<String>停止词
batch_size: Option<u32>批处理大小
max_concurrent_requests: Option<u32>并发请求数
gpu_device_ids: Vec<u32>GPU 设备ID
memory_limit_mb: Option<u64>内存限制 (MB)
enable_streaming: bool是否启用流式输出
custom_params: HashMap<String, Value>自定义参数
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimeConfig
impl Debug for RuntimeConfig
Source§impl Default for RuntimeConfig
impl Default for RuntimeConfig
Source§impl<'de> Deserialize<'de> for RuntimeConfig
impl<'de> Deserialize<'de> for RuntimeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more