fix chatglm in run.pu (#8919)
This commit is contained in:
		
							parent
							
								
									e9de9d9950
								
							
						
					
					
						commit
						d8a01d7c4f
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -127,6 +127,8 @@ def run_transformer_int4(repo_id,
 | 
				
			||||||
            # slice the input_ids to ensure the prompt length is required length.
 | 
					            # slice the input_ids to ensure the prompt length is required length.
 | 
				
			||||||
            input_ids = tokenizer.encode(input_str, return_tensors="pt")
 | 
					            input_ids = tokenizer.encode(input_str, return_tensors="pt")
 | 
				
			||||||
            input_ids = input_ids[:, :in_len]
 | 
					            input_ids = input_ids[:, :in_len]
 | 
				
			||||||
 | 
					            true_str = tokenizer.batch_decode(input_ids)[0]
 | 
				
			||||||
 | 
					            input_ids = tokenizer.encode(true_str, return_tensors="pt")
 | 
				
			||||||
            result[in_out] = []
 | 
					            result[in_out] = []
 | 
				
			||||||
            for i in range(num_trials + warm_up):
 | 
					            for i in range(num_trials + warm_up):
 | 
				
			||||||
                st = time.perf_counter()
 | 
					                st = time.perf_counter()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue