Browse Source
        
      
      Add PyOperator
      
        Signed-off-by: Kaiyuan Hu <kaiyuan.hu@zilliz.com>
      
      
        main
      
      
     
    
    
    
	
		
			
				 1 changed files with 
2 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					select_video.py
				
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -16,10 +16,11 @@ from itertools import groupby | 
			
		
	
		
			
				
					|  |  |  | from typing import List | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | from towhee import register | 
			
		
	
		
			
				
					|  |  |  | from towhee.operator import PyOperator | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | @register(output_schema=['vec']) | 
			
		
	
		
			
				
					|  |  |  | class SelectVideo: | 
			
		
	
		
			
				
					|  |  |  | class SelectVideo(PyOperator): | 
			
		
	
		
			
				
					|  |  |  |     def __init__(self, top_k: int, reduce_function: str = 'sum', reverse: bool = True): | 
			
		
	
		
			
				
					|  |  |  |         self.top_k = top_k | 
			
		
	
		
			
				
					|  |  |  |         self.reduce_function = reduce_function | 
			
		
	
	
		
			
				
					|  |  | 
 |