Fix MiniCPM-V-2_6 running on NPU (#12486)
This commit is contained in:
		
							parent
							
								
									598603bea6
								
							
						
					
					
						commit
						5fe766788e
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -198,7 +198,7 @@ class MinicpmVLayerNorm(torch.nn.Module):
 | 
			
		|||
 | 
			
		||||
@module_optimization
 | 
			
		||||
def replace_with_Layernorm(layer, qtype=None, device='NPU',
 | 
			
		||||
                           modules_to_not_convert=[], group_size=0):
 | 
			
		||||
                           modules_to_not_convert=[], group_size=0, imatrix=None):
 | 
			
		||||
    if isinstance(layer, torch.nn.LayerNorm):
 | 
			
		||||
        return MinicpmVLayerNorm(
 | 
			
		||||
            weight=layer.weight.to(torch.float16),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue