mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fixes #222
This commit is contained in:
		| @@ -158,7 +158,7 @@ class Consumer(LoggingMixin): | ||||
|         try: | ||||
|             classifier = DocumentClassifier() | ||||
|             classifier.reload() | ||||
|         except (FileNotFoundError, IncompatibleClassifierVersionError) as e: | ||||
|         except (OSError, EOFError, IncompatibleClassifierVersionError) as e: | ||||
|             self.log( | ||||
|                 "warning", | ||||
|                 f"Cannot classify documents: {e}.") | ||||
|   | ||||
| @@ -73,7 +73,7 @@ class Command(Renderable, BaseCommand): | ||||
|         classifier = DocumentClassifier() | ||||
|         try: | ||||
|             classifier.reload() | ||||
|         except (FileNotFoundError, IncompatibleClassifierVersionError) as e: | ||||
|         except (OSError, EOFError, IncompatibleClassifierVersionError) as e: | ||||
|             logging.getLogger(__name__).warning( | ||||
|                 f"Cannot classify documents: {e}.") | ||||
|             classifier = None | ||||
|   | ||||
| @@ -35,9 +35,9 @@ def train_classifier(): | ||||
|     try: | ||||
|         # load the classifier, since we might not have to train it again. | ||||
|         classifier.reload() | ||||
|     except (FileNotFoundError, IncompatibleClassifierVersionError): | ||||
|     except (OSError, EOFError, IncompatibleClassifierVersionError): | ||||
|         # This is what we're going to fix here. | ||||
|         pass | ||||
|         classifier = DocumentClassifier() | ||||
|  | ||||
|     try: | ||||
|         if classifier.train(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler