Browse Source
        
      
      l
      
        Signed-off-by: xujinling <jinling.xu@zilliz.com>
      
      
        main
      
      
     
    
      
        
          
            
            xujinling
          
          3 years ago
          
         
        
        
       
      
     
    
    
	
		
			
				 1 changed files with 
2 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					bridge_former.py
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -84,7 +84,8 @@ class BridgeFormer(NNOperator): | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    def _inference_from_text(self, text: List[str]): | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if self.model_name == "clip_initialized_model": | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            text_data = self.tokenizer(text, return_tensors='pt', padding='max_length', max_length=77).to(self.device) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            text_data = self.tokenizer(text, return_tensors='pt', padding='max_length', max_length=77, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                       truncation=True).to(self.device) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            text_features = self.model.encode_text(text_data["input_ids"]) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        else: | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            text_data = self.tokenizer(text, return_tensors='pt').to(self.device) | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |