Fix MiniCPM-V models running on NPU (#12478)
This commit is contained in:
		
							parent
							
								
									54d9a590d4
								
							
						
					
					
						commit
						31c69a8d31
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -276,7 +276,8 @@ class _BaseAutoModelClass:
 | 
				
			||||||
        model.share_memory()
 | 
					        model.share_memory()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not pipeline:
 | 
					        if not pipeline:
 | 
				
			||||||
            if model.config.model_type in ["qwen2", "llama", "minicpm"]:
 | 
					            if (not hasattr(model, 'llm') and
 | 
				
			||||||
 | 
					                    model.config.model_type in ["qwen2", "llama", "minicpm"]):
 | 
				
			||||||
                from ipex_llm.transformers.npu_models.convert import optimize_llm_single_process
 | 
					                from ipex_llm.transformers.npu_models.convert import optimize_llm_single_process
 | 
				
			||||||
                optimize_llm_single_process(
 | 
					                optimize_llm_single_process(
 | 
				
			||||||
                    llm,
 | 
					                    llm,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue