mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-01 00:17:44 +03:00 
			
		
		
		
	Exclude common cache directories from mode list in cli.info
This means models called "cache" etc. won't show up in the list, but it seems worth it.
This commit is contained in:
		
							parent
							
								
									d17072cbd5
								
							
						
					
					
						commit
						8de5108af6
					
				|  | @ -45,5 +45,9 @@ def get_spacy_data(): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def list_models(): | def list_models(): | ||||||
|  |     # exclude common cache directories – this means models called "cache" etc. | ||||||
|  |     # won't show up in list, but it seems worth it | ||||||
|  |     exclude = ['cache', 'pycache', '__pycache__'] | ||||||
|     data_path = util.get_data_path() |     data_path = util.get_data_path() | ||||||
|     return [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] |     models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] | ||||||
|  |     return [m for m in models if m not in exclude] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user