fix: feste GPUs durch Startprofil anzeigen, Hilfetext zum Speicherbedarf richtigstellen (#1272)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -93,6 +93,12 @@ impl GpuWahl {
|
||||
/// Modell als fest.
|
||||
const GPU_PARAMETER: [&str; 4] = ["gpu", "split_mode", "tensor_split", "main_gpu"];
|
||||
|
||||
fn haelt_gpus_fest(parameter: &std::collections::BTreeMap<String, String>) -> bool {
|
||||
GPU_PARAMETER
|
||||
.iter()
|
||||
.any(|name| parameter.contains_key(*name))
|
||||
}
|
||||
|
||||
/// Alles, was zum Starten einer Instanz nötig ist.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct StartPlan {
|
||||
@ -694,10 +700,7 @@ impl Store {
|
||||
gpus.len(),
|
||||
)
|
||||
.map_err(|e| Error::Config(e.into()))?;
|
||||
let gpu_wahl = if GPU_PARAMETER
|
||||
.iter()
|
||||
.any(|name| start_parameters.contains_key(*name))
|
||||
{
|
||||
let gpu_wahl = if haelt_gpus_fest(&start_parameters) {
|
||||
GpuWahl::Fest
|
||||
} else {
|
||||
GpuWahl::parse(&wahl)
|
||||
@ -726,6 +729,14 @@ impl Store {
|
||||
}))
|
||||
}
|
||||
|
||||
/// `true`, wenn das Startprofil Angaben zu bestimmten Karten enthält: Das Modell gilt dann als fest,
|
||||
/// gleich welche GPU-Wahl gespeichert ist.
|
||||
pub fn startprofil_haelt_gpus_fest(&self, model: &str) -> Result<bool> {
|
||||
Ok(self
|
||||
.start_parameters(model)?
|
||||
.is_some_and(|p| haelt_gpus_fest(&p)))
|
||||
}
|
||||
|
||||
/// Setzt oder entfernt die Angabe zum Arbeitsspeicher für alle Profile des Modells.
|
||||
pub fn set_profile_ram(&self, model: &str, ram_mb: Option<i64>) -> Result<bool> {
|
||||
let changed = self
|
||||
|
||||
Reference in New Issue
Block a user