fix: move db path, fix compile error (#820)
parent
33e817e1bc
commit
fcfa13136a
|
|
@ -14,7 +14,7 @@ pub async fn load_text_generation(
|
||||||
parallelism: u8,
|
parallelism: u8,
|
||||||
) -> (Arc<dyn TextGeneration>, PromptInfo) {
|
) -> (Arc<dyn TextGeneration>, PromptInfo) {
|
||||||
#[cfg(feature = "experimental-http")]
|
#[cfg(feature = "experimental-http")]
|
||||||
if args.device == crate::serve::Device::ExperimentalHttp {
|
if device == &Device::ExperimentalHttp {
|
||||||
let (engine, prompt_template) = http_api_bindings::create(model_id);
|
let (engine, prompt_template) = http_api_bindings::create(model_id);
|
||||||
return (
|
return (
|
||||||
engine,
|
engine,
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,10 @@ lazy_static! {
|
||||||
),]);
|
),]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn db_file() -> PathBuf {
|
async fn db_path() -> Result<PathBuf> {
|
||||||
tabby_root().join("db.sqlite3")
|
let db_dir = tabby_root().join("ee");
|
||||||
|
tokio::fs::create_dir_all(db_dir.clone()).await?;
|
||||||
|
Ok(db_dir.join("db.sqlite"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DbConn {
|
pub struct DbConn {
|
||||||
|
|
@ -31,7 +33,8 @@ pub struct DbConn {
|
||||||
|
|
||||||
impl DbConn {
|
impl DbConn {
|
||||||
pub async fn new() -> Result<Self> {
|
pub async fn new() -> Result<Self> {
|
||||||
let conn = Connection::open(db_file()).await?;
|
let db_path = db_path().await?;
|
||||||
|
let conn = Connection::open(db_path).await?;
|
||||||
Self::init_db(conn).await
|
Self::init_db(conn).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue