mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-29 06:57:49 +03:00 
			
		
		
		
	if-else
This commit is contained in:
		
							parent
							
								
									4fa967ea84
								
							
						
					
					
						commit
						1f465bea18
					
				|  | @ -1361,11 +1361,12 @@ def check_bool_env_var(env_var: str) -> bool: | |||
| def _pipe(docs, proc, kwargs): | ||||
|     if hasattr(proc, "pipe"): | ||||
|         yield from proc.pipe(docs, **kwargs) | ||||
|     # We added some args for pipe that __call__ doesn't expect. | ||||
|     kwargs = dict(kwargs) | ||||
|     for arg in ["batch_size"]: | ||||
|         if arg in kwargs: | ||||
|             kwargs.pop(arg) | ||||
|     for doc in docs: | ||||
|         doc = proc(doc, **kwargs) | ||||
|         yield doc | ||||
|     else: | ||||
|         # We added some args for pipe that __call__ doesn't expect. | ||||
|         kwargs = dict(kwargs) | ||||
|         for arg in ["batch_size"]: | ||||
|             if arg in kwargs: | ||||
|                 kwargs.pop(arg) | ||||
|         for doc in docs: | ||||
|             doc = proc(doc, **kwargs) | ||||
|             yield doc | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user