Skip to content

Commit 17812c4

Browse files
committed
refactor!: improve ApiServer and ModelConfig
Signed-off-by: Xin Liu <[email protected]>
1 parent fa3fbb9 commit 17812c4

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

src/main.rs

-31
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,10 @@ async fn main() -> Result<(), ServerError> {
238238
let server_info = ApiServer {
239239
ty: "sd".to_string(),
240240
version: env!("CARGO_PKG_VERSION").to_string(),
241-
plugin_version: "Unknown".to_string(),
242241
port: addr.port().to_string(),
243242
image_model: Some(ModelConfig {
244243
name: cli.model_name,
245244
ty: "image".to_string(),
246-
..Default::default()
247245
}),
248246
extras: HashMap::new(),
249247
};
@@ -461,8 +459,6 @@ pub(crate) struct ApiServer {
461459
#[serde(rename = "type")]
462460
ty: String,
463461
version: String,
464-
#[serde(rename = "ggml_plugin_version")]
465-
plugin_version: String,
466462
port: String,
467463
#[serde(skip_serializing_if = "Option::is_none")]
468464
image_model: Option<ModelConfig>,
@@ -476,31 +472,4 @@ pub(crate) struct ModelConfig {
476472
// type: image
477473
#[serde(rename = "type")]
478474
ty: String,
479-
pub ctx_size: u64,
480-
pub batch_size: u64,
481-
pub ubatch_size: u64,
482-
#[serde(skip_serializing_if = "Option::is_none")]
483-
pub n_predict: Option<i32>,
484-
#[serde(skip_serializing_if = "Option::is_none")]
485-
pub reverse_prompt: Option<String>,
486-
#[serde(skip_serializing_if = "Option::is_none")]
487-
pub n_gpu_layers: Option<u64>,
488-
#[serde(skip_serializing_if = "Option::is_none")]
489-
pub use_mmap: Option<bool>,
490-
#[serde(skip_serializing_if = "Option::is_none")]
491-
pub temperature: Option<f64>,
492-
#[serde(skip_serializing_if = "Option::is_none")]
493-
pub top_p: Option<f64>,
494-
#[serde(skip_serializing_if = "Option::is_none")]
495-
pub repeat_penalty: Option<f64>,
496-
#[serde(skip_serializing_if = "Option::is_none")]
497-
pub presence_penalty: Option<f64>,
498-
#[serde(skip_serializing_if = "Option::is_none")]
499-
pub frequency_penalty: Option<f64>,
500-
#[serde(skip_serializing_if = "Option::is_none")]
501-
pub split_mode: Option<String>,
502-
#[serde(skip_serializing_if = "Option::is_none")]
503-
pub main_gpu: Option<u64>,
504-
#[serde(skip_serializing_if = "Option::is_none")]
505-
pub tensor_split: Option<String>,
506475
}

0 commit comments

Comments
 (0)