Skip to content

Commit

Permalink
fix: improve download logging (#325)
Browse files Browse the repository at this point in the history
* Suggest use `-it` so docker run generate progress bar of downloading information properly

* add info! log for model download
  • Loading branch information
wsxiaoys authored Aug 2, 2023
1 parent b8308b7 commit 57c811b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/tabby-download/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ reqwest = { version = "0.11.18", features = ["stream", "json"] }
anyhow = { workspace = true }
serde = { workspace = true }
serdeconv = { workspace = true }
tracing = { worksapce = true }
tokio-retry = "0.3.0"
3 changes: 3 additions & 0 deletions crates/tabby-download/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use tokio_retry::{
strategy::{jitter, ExponentialBackoff},
Retry,
};
use tracing::info;

impl CacheInfo {
async fn download(
Expand Down Expand Up @@ -62,6 +63,8 @@ pub async fn download_model(model_id: &str, prefer_local_file: bool) -> Result<(
return Ok(());
}

info!("Start downloading model `{}`", model_id);

let mut cache_info = CacheInfo::from(model_id).await;

let optional_files = vec![
Expand Down
4 changes: 2 additions & 2 deletions website/docs/self-hosting/01-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem';
<TabItem value="shell" label="Shell" default>

```bash title="run.sh"
docker run \
docker run -it \
-p 8080:8080 -v $HOME/.tabby:/data \
tabbyml/tabby serve --model TabbyML/SantaCoder-1B
```
Expand Down Expand Up @@ -43,7 +43,7 @@ services:
<TabItem value="shell" label="Shell" default>

```bash title="run.sh"
docker run \
docker run -it \
--gpus all -p 8080:8080 -v $HOME/.tabby:/data \
tabbyml/tabby \
serve --model TabbyML/SantaCoder-1B --device cuda
Expand Down

0 comments on commit 57c811b

Please sign in to comment.