Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed May 2, 2024
1 parent cbf7006 commit 1b12499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
20 changes: 9 additions & 11 deletions crates/tabby/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ pub struct ServeArgs {
}

pub async fn main(config: &Config, args: &ServeArgs) {
#[cfg(feature = "experimental-http")]
if args.device == Device::ExperimentalHttp {
tracing::warn!("HTTP device is unstable and does not comply with semver expectations.");
} else {
load_model(args).await;
}
#[cfg(not(feature = "experimental-http"))]
load_model(args).await;

info!("Starting server, this might take a few minutes...");
Expand Down Expand Up @@ -175,12 +168,17 @@ pub async fn main(config: &Config, args: &ServeArgs) {
}

async fn load_model(args: &ServeArgs) {
if let Some(model) = &args.model {
download_model_if_needed(model).await;
if args.device != Device::ExperimentalHttp {
if let Some(model) = &args.model {
download_model_if_needed(model).await;
}
}

if let Some(chat_model) = &args.chat_model {
download_model_if_needed(chat_model).await
let chat_device = args.chat_device.as_ref().unwrap_or(&args.device);
if chat_device != &Device::ExperimentalHttp {
if let Some(chat_model) = &args.chat_model {
download_model_if_needed(chat_model).await
}
}
}

Expand Down
1 change: 0 additions & 1 deletion crates/tabby/src/services/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub async fn load_chat_completion(
device: &Device,
parallelism: u8,
) -> Arc<dyn ChatCompletionStream> {
println!("load_chat_completion: model_id: {}, device: {}, parallelism: {}", model_id, device, parallelism);
#[cfg(feature = "experimental-http")]
if device == &Device::ExperimentalHttp {
return http_api_bindings::create_chat(model_id);
Expand Down

0 comments on commit 1b12499

Please sign in to comment.