LLM: Explicitly close pickle file pointer before removing temporary directory (#9120)
* fp close
This commit is contained in:
		
							parent
							
								
									0e09dd926b
								
							
						
					
					
						commit
						1709beba5b
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -179,6 +179,7 @@ def lazyload(
 | 
			
		|||
                      f"but get {pickle_paths}. ")
 | 
			
		||||
    pickle_fp = zf.open(pickle_paths[0], 'r')
 | 
			
		||||
    state_dict = _load(pickle_fp, None, pickle, pickle_file=pickle_paths[0][:-4], zip_file=zf)
 | 
			
		||||
    fp.close()  # Otherwise on windows this may be marked as reading
 | 
			
		||||
    return state_dict
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue