fix: improve download logging (#325)
* Suggest use `-it` so docker run generate progress bar of downloading information properly * add info! log for model downloadrelease-0.0
parent
b8308b7118
commit
57c811b30f
|
|
@ -2834,6 +2834,7 @@ dependencies = [
|
||||||
"serdeconv",
|
"serdeconv",
|
||||||
"tabby-common",
|
"tabby-common",
|
||||||
"tokio-retry",
|
"tokio-retry",
|
||||||
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,5 @@ reqwest = { version = "0.11.18", features = ["stream", "json"] }
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serdeconv = { workspace = true }
|
serdeconv = { workspace = true }
|
||||||
|
tracing = { worksapce = true }
|
||||||
tokio-retry = "0.3.0"
|
tokio-retry = "0.3.0"
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ use tokio_retry::{
|
||||||
strategy::{jitter, ExponentialBackoff},
|
strategy::{jitter, ExponentialBackoff},
|
||||||
Retry,
|
Retry,
|
||||||
};
|
};
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
impl CacheInfo {
|
impl CacheInfo {
|
||||||
async fn download(
|
async fn download(
|
||||||
|
|
@ -62,6 +63,8 @@ pub async fn download_model(model_id: &str, prefer_local_file: bool) -> Result<(
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info!("Start downloading model `{}`", model_id);
|
||||||
|
|
||||||
let mut cache_info = CacheInfo::from(model_id).await;
|
let mut cache_info = CacheInfo::from(model_id).await;
|
||||||
|
|
||||||
let optional_files = vec![
|
let optional_files = vec![
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem';
|
||||||
<TabItem value="shell" label="Shell" default>
|
<TabItem value="shell" label="Shell" default>
|
||||||
|
|
||||||
```bash title="run.sh"
|
```bash title="run.sh"
|
||||||
docker run \
|
docker run -it \
|
||||||
-p 8080:8080 -v $HOME/.tabby:/data \
|
-p 8080:8080 -v $HOME/.tabby:/data \
|
||||||
tabbyml/tabby serve --model TabbyML/SantaCoder-1B
|
tabbyml/tabby serve --model TabbyML/SantaCoder-1B
|
||||||
```
|
```
|
||||||
|
|
@ -43,7 +43,7 @@ services:
|
||||||
<TabItem value="shell" label="Shell" default>
|
<TabItem value="shell" label="Shell" default>
|
||||||
|
|
||||||
```bash title="run.sh"
|
```bash title="run.sh"
|
||||||
docker run \
|
docker run -it \
|
||||||
--gpus all -p 8080:8080 -v $HOME/.tabby:/data \
|
--gpus all -p 8080:8080 -v $HOME/.tabby:/data \
|
||||||
tabbyml/tabby \
|
tabbyml/tabby \
|
||||||
serve --model TabbyML/SantaCoder-1B --device cuda
|
serve --model TabbyML/SantaCoder-1B --device cuda
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue