Add model description in lora details

This commit is contained in:
Will Miao
2025-03-10 00:20:31 +08:00
parent e8e5012f0c
commit 0069f84630
5 changed files with 495 additions and 58 deletions

View File

@@ -325,4 +325,19 @@ export async function refreshSingleLoraMetadata(filePath) {
state.loadingManager.hide();
state.loadingManager.restoreProgressBar();
}
}
export async function fetchModelDescription(modelId, filePath) {
try {
const response = await fetch(`/api/lora-model-description?model_id=${modelId}&file_path=${encodeURIComponent(filePath)}`);
if (!response.ok) {
throw new Error(`Failed to fetch model description: ${response.statusText}`);
}
return await response.json();
} catch (error) {
console.error('Error fetching model description:', error);
throw error;
}
}