Fix lightweight-serving codegeex error (#11759)
This commit is contained in:
		
							parent
							
								
									66fe2ee464
								
							
						
					
					
						commit
						245dba0abc
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -275,11 +275,11 @@ def get_prompt(messages) -> str:
 | 
			
		|||
        if len(messages) <= 1:
 | 
			
		||||
            history = []
 | 
			
		||||
        else:
 | 
			
		||||
            history = [msg.model_dump() for msg in messages[:-1]]
 | 
			
		||||
            history = [msg for msg in messages[:-1]]
 | 
			
		||||
        history.append({"role": "user", "content": query})
 | 
			
		||||
        inputs = tokenizer.apply_chat_template(history, add_generation_prompt=True, tokenize=False,
 | 
			
		||||
                                               return_tensors="pt", return_dict=False)
 | 
			
		||||
        return inputs
 | 
			
		||||
        return inputs, []
 | 
			
		||||
    else:
 | 
			
		||||
        prompt = ""
 | 
			
		||||
        image_list = []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue