Spaces:
Sleeping
Sleeping
Added read_txt
Browse files
utils.py
CHANGED
@@ -7,7 +7,7 @@ class Test:
|
|
7 |
|
8 |
def __init__(self):
|
9 |
self.data = self.read_test_data()
|
10 |
-
self.descriptions = self.
|
11 |
|
12 |
def __len__(self):
|
13 |
return len(self.data)
|
@@ -19,8 +19,8 @@ class Test:
|
|
19 |
return test_data
|
20 |
|
21 |
@staticmethod
|
22 |
-
def
|
23 |
-
with open(
|
24 |
lines = f.readlines()
|
25 |
clean_lines = [line.strip() for line in lines]
|
26 |
return clean_lines
|
|
|
7 |
|
8 |
def __init__(self):
|
9 |
self.data = self.read_test_data()
|
10 |
+
self.descriptions = self.read_txt("images/descriptions.txt")
|
11 |
|
12 |
def __len__(self):
|
13 |
return len(self.data)
|
|
|
19 |
return test_data
|
20 |
|
21 |
@staticmethod
|
22 |
+
def read_txt(path):
|
23 |
+
with open(path) as f:
|
24 |
lines = f.readlines()
|
25 |
clean_lines = [line.strip() for line in lines]
|
26 |
return clean_lines
|