This repository was archived by the owner on Jul 7, 2023. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed 
tensor2tensor/data_generators/wikisum Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2424
2525import  tensorflow  as  tf 
2626
27- pkg_dir , _  =  os .path .split (__file__ )
27+ pkg_dir  =  os .path .abspath (__file__ )
28+ pkg_dir , _  =  os .path .split (pkg_dir )
2829_TESTDATA  =  os .path .join (pkg_dir , "test_data" )
2930
3031
3132def  _get_testdata (filename ):
32-   with  tf .gfile .Open ( os . path . join ( _TESTDATA ,  filename ) ) as  f :
33+   with  tf .io . gfile .GFile ( filename ) as  f :
3334    return  f .read ()
3435
3536
3637class  UtilsTest (tf .test .TestCase ):
3738
3839  def  test_filter_paragraph (self ):
39-     for  bad  in  tf .gfile .Glob (os .path .join (_TESTDATA , "para_bad*.txt" )):
40+     for  bad  in  tf .io . gfile .glob (os .path .join (_TESTDATA , "para_bad*.txt" )):
4041      for  p  in  _get_testdata (bad ).split ("\n " ):
4142        self .assertTrue (utils .filter_paragraph (p ),
4243                        msg = "Didn't filter %s"  %  p )
43-     for  good  in  tf .gfile .Glob (os .path .join (_TESTDATA , "para_good*.txt" )):
44+     for  good  in  tf .io . gfile .glob (os .path .join (_TESTDATA , "para_good*.txt" )):
4445      for  p  in  _get_testdata (good ).split ("\n " ):
4546        p  =  _get_testdata (good )
4647      self .assertFalse (utils .filter_paragraph (p ), msg = "Filtered %s"  %  p )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments