mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Handles a special case where the classification model exists, but no items are auto matching any longer
This commit is contained in:
		| @@ -65,6 +65,12 @@ def train_classifier(): | ||||
|         and not Correspondent.objects.filter(matching_algorithm=Tag.MATCH_AUTO).exists() | ||||
|         and not StoragePath.objects.filter(matching_algorithm=Tag.MATCH_AUTO).exists() | ||||
|     ): | ||||
|         logger.info("No automatic matching items, not training") | ||||
|         # Special case, items were once auto and trained, so remove the model | ||||
|         # and prevent its use again | ||||
|         if settings.MODEL_FILE.exists(): | ||||
|             logger.info(f"Removing {settings.MODEL_FILE} so it won't be used") | ||||
|             settings.MODEL_FILE.unlink() | ||||
|         return | ||||
|  | ||||
|     classifier = load_classifier() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Trenton H
					Trenton H