Corey Morris commited on
Commit
794b32b
1 Parent(s): 324764c

Returning just a single file per model directory. Manually removing gpt-j-6b for now because there is something that is causing problems with processing the data

Browse files
Files changed (1) hide show
  1. result_data_processor.py +7 -4
result_data_processor.py CHANGED
@@ -13,14 +13,17 @@ class ResultDataProcessor:
13
  self.data = self.process_data()
14
  self.ranked_data = self.rank_data()
15
 
16
- @staticmethod
17
- def _find_files(directory, pattern):
18
  for root, dirs, files in os.walk(directory):
19
  for basename in files:
20
  if fnmatch.fnmatch(basename, pattern):
21
  filename = os.path.join(root, basename)
22
- yield filename
23
-
 
 
 
24
  def _read_and_transform_data(self, filename):
25
  with open(filename) as f:
26
  data = json.load(f)
 
13
  self.data = self.process_data()
14
  self.ranked_data = self.rank_data()
15
 
16
+ def _find_files(self, directory='results', pattern='results*.json'):
17
+ matching_files = {}
18
  for root, dirs, files in os.walk(directory):
19
  for basename in files:
20
  if fnmatch.fnmatch(basename, pattern):
21
  filename = os.path.join(root, basename)
22
+ matching_files[root] = filename
23
+ matching_files = {key: value for key, value in matching_files.items() if 'gpt-j-6b' not in key}
24
+ matching_files = list(matching_files.values())
25
+ return matching_files
26
+
27
  def _read_and_transform_data(self, filename):
28
  with open(filename) as f:
29
  data = json.load(f)