Refactor UI state management (#1191)

* Added logs at generation of the UI, and generate the UI in an object
* Make ingest script more verbose in case of an error at ingestion time
* Removed the explicit state in the UI containing ingested files
* Make script of ingestion a bit more verbose by displaying stack traces
* Change the browser tab title of privateGPT ui to `My Private GPT`
This commit is contained in:
lopagela
2023-11-10 10:42:43 +01:00
committed by GitHub
parent 55e626eac7
commit a666fd5b73
3 changed files with 170 additions and 137 deletions

View File

@@ -69,8 +69,10 @@ def _do_ingest(changed_path: Path) -> None:
logger.info(f"Started ingesting {changed_path}")
ingest_service.ingest(changed_path.name, changed_path)
logger.info(f"Completed ingesting {changed_path}")
except Exception as e:
logger.error(f"Failed to ingest document: {changed_path}. Error: {e}")
except Exception:
logger.exception(
f"Failed to ingest document: {changed_path}, find the exception attached"
)
path = Path(args.folder)