File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -291,11 +291,17 @@ def eval_llama(
291291    # Generate the eval wrapper 
292292    eval_wrapper  =  gen_eval_wrapper (model_name , args )
293293
294+     # Needed for loading mmlu dataset. 
295+     # See https://github.com/EleutherAI/lm-evaluation-harness/pull/1998/files 
296+     if  args .tasks  and  "mmlu"  in  args .tasks :
297+         import  datasets 
298+ 
299+         datasets .config .HF_DATASETS_TRUST_REMOTE_CODE  =  True 
300+ 
294301    # Evaluate the model 
295302    with  torch .no_grad ():
296303        eval_results  =  simple_evaluate (
297304            model = eval_wrapper ,
298-             model_args = "trust_remote_code=True" ,
299305            tasks = args .tasks ,  # pyre-ignore: Undefined attribute [16]: `argparse.ArgumentParser` has no attribute `tasks` 
300306            num_fewshot = args .num_fewshot ,  # pyre-ignore: Undefined attribute [16]: `argparse.ArgumentParser` has no attribute `num_fewshot` 
301307            limit = args .limit ,  # pyre-ignore: Undefined attribute [16]: `argparse.ArgumentParser` has no attribute `limit` 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments