feat: Modellarten und persönliche Stimmenfreigabe ergänzen
This commit is contained in:
@ -80,6 +80,8 @@ pub struct ModelDetails {
|
||||
pub path: String,
|
||||
pub gpus: Vec<u32>,
|
||||
pub context: Option<u32>,
|
||||
pub quantization: Option<String>,
|
||||
pub size_bytes: Option<i64>,
|
||||
}
|
||||
|
||||
/// Ergebnis von [`Store::remove_model`].
|
||||
@ -250,7 +252,7 @@ impl Store {
|
||||
/// Freigabe. `None`, wenn es das Modell nicht gibt.
|
||||
pub fn model_details(&self, model: &str) -> Result<Option<ModelDetails>> {
|
||||
let row = self.connection().query_row(
|
||||
"SELECT e.name, a.pfad, p.gpus, p.kontext
|
||||
"SELECT e.name, a.pfad, p.gpus, p.kontext, a.quantisierung, a.groesse_bytes
|
||||
FROM model m
|
||||
JOIN artifact a ON a.model_id = m.id
|
||||
JOIN engine e ON e.id = a.engine_id
|
||||
@ -264,15 +266,19 @@ impl Store {
|
||||
r.get::<_, String>(1)?,
|
||||
r.get::<_, String>(2)?,
|
||||
r.get::<_, Option<u32>>(3)?,
|
||||
r.get::<_, Option<String>>(4)?,
|
||||
r.get::<_, Option<i64>>(5)?,
|
||||
))
|
||||
},
|
||||
);
|
||||
match row {
|
||||
Ok((engine, path, gpus, context)) => Ok(Some(ModelDetails {
|
||||
Ok((engine, path, gpus, context, quantization, size_bytes)) => Ok(Some(ModelDetails {
|
||||
engine,
|
||||
path,
|
||||
gpus: parse_gpus(&gpus)?,
|
||||
context,
|
||||
quantization,
|
||||
size_bytes,
|
||||
})),
|
||||
Err(rusqlite::Error::QueryReturnedNoRows) => Ok(None),
|
||||
Err(e) => Err(db(e)),
|
||||
|
||||
Reference in New Issue
Block a user