fix & logging

This commit is contained in:
Alex "mcmonkey" Goodwin 2024-09-19 20:05:14 +09:00
parent 68f8d8c568
commit c539ee55f4
2 changed files with 3 additions and 2 deletions

View File

@ -88,7 +88,7 @@ async def download_model(model_download_request: Callable[[str], Awaitable[aioht
return DownloadModelStatus(
DownloadStatusType.ERROR,
0,
"Invalid folder path, does not match the list of known directories. If you're seeing this in the downloader UI, you may need to refresh the page.",
f"Invalid folder path '{folder_path}', does not match the list of known directories ({get_folder_paths(model_directory)}). If you're seeing this in the downloader UI, you may need to refresh the page.",
False
)
@ -98,6 +98,7 @@ async def download_model(model_download_request: Callable[[str], Awaitable[aioht
return existing_file
try:
logging.info(f"Downloading {model_name} from {model_url}")
status = DownloadModelStatus(DownloadStatusType.PENDING, 0, f"Starting download of {model_name}", False)
await progress_callback(model_name, status)

View File

@ -696,7 +696,7 @@ class PromptServer():
logging.error("Client session is not initialized")
return web.Response(status=500)
task = asyncio.create_task(download_model(lambda url: session.get(url), model_filename, url, model_directory, report_progress, progress_interval, folder_path))
task = asyncio.create_task(download_model(lambda url: session.get(url), model_filename, url, model_directory, folder_path, report_progress, progress_interval))
await task
return web.json_response(task.result().to_dict())