Corey Morris
commited on
Commit
·
30fa96a
1
Parent(s):
c32735e
Find files is working as expected
Browse files
details_data_processor.py
CHANGED
|
@@ -10,7 +10,7 @@ class DetailsDataProcessor:
|
|
| 10 |
# Download
|
| 11 |
#url example https://huggingface.co/datasets/open-llm-leaderboard/details/resolve/main/64bits/LexPodLM-13B/details_harness%7ChendrycksTest-moral_scenarios%7C5_2023-07-25T13%3A41%3A51.227672.json
|
| 12 |
|
| 13 |
-
def __init__(self, directory='results', pattern='
|
| 14 |
self.directory = directory
|
| 15 |
self.pattern = pattern
|
| 16 |
# self.data = self.process_data()
|
|
@@ -73,7 +73,8 @@ class DetailsDataProcessor:
|
|
| 73 |
|
| 74 |
def pipeline(self):
|
| 75 |
dataframes = []
|
| 76 |
-
|
|
|
|
| 77 |
print(file_path)
|
| 78 |
url = self.generate_url(file_path)
|
| 79 |
file_path = file_path.split('/')[-1]
|
|
|
|
| 10 |
# Download
|
| 11 |
#url example https://huggingface.co/datasets/open-llm-leaderboard/details/resolve/main/64bits/LexPodLM-13B/details_harness%7ChendrycksTest-moral_scenarios%7C5_2023-07-25T13%3A41%3A51.227672.json
|
| 12 |
|
| 13 |
+
def __init__(self, directory='results', pattern='results*.json'):
|
| 14 |
self.directory = directory
|
| 15 |
self.pattern = pattern
|
| 16 |
# self.data = self.process_data()
|
|
|
|
| 73 |
|
| 74 |
def pipeline(self):
|
| 75 |
dataframes = []
|
| 76 |
+
file_paths = self._find_files(self.directory, self.pattern)
|
| 77 |
+
for file_path in file_paths:
|
| 78 |
print(file_path)
|
| 79 |
url = self.generate_url(file_path)
|
| 80 |
file_path = file_path.split('/')[-1]
|
test_details_data_processing.py
CHANGED
|
@@ -36,10 +36,10 @@ class TestDetailsDataProcessor(unittest.TestCase):
|
|
| 36 |
|
| 37 |
def test_find_files(self):
|
| 38 |
directory = 'results'
|
| 39 |
-
pattern = '
|
| 40 |
files = self.processor._find_files(directory, pattern)
|
| 41 |
-
breakpoint()
|
| 42 |
-
print(files)
|
| 43 |
self.assertIsInstance(files, list)
|
| 44 |
|
| 45 |
|
|
|
|
| 36 |
|
| 37 |
def test_find_files(self):
|
| 38 |
directory = 'results'
|
| 39 |
+
pattern = 'results*.json'
|
| 40 |
files = self.processor._find_files(directory, pattern)
|
| 41 |
+
# breakpoint()
|
| 42 |
+
# print(files)
|
| 43 |
self.assertIsInstance(files, list)
|
| 44 |
|
| 45 |
|