Upload folder using huggingface_hub
Browse files- train_and_test.py +4 -0
train_and_test.py
CHANGED
|
@@ -121,6 +121,8 @@ print('Loading training files into RAM...')
|
|
| 121 |
train_wo, train_w, train_lbl = [], [], []
|
| 122 |
for fp in trainpath:
|
| 123 |
wo, w, lbl = load_data(fp)
|
|
|
|
|
|
|
| 124 |
train_wo.append(wo)
|
| 125 |
train_w.append(w)
|
| 126 |
train_lbl.append(lbl)
|
|
@@ -143,6 +145,8 @@ print('Loading testing files into RAM...')
|
|
| 143 |
test_wo, test_w, test_lbl = [], [], []
|
| 144 |
for fp in testpath:
|
| 145 |
wo, w, lbl = load_data(fp)
|
|
|
|
|
|
|
| 146 |
test_wo.append(wo)
|
| 147 |
test_w.append(w)
|
| 148 |
test_lbl.append(lbl)
|
|
|
|
| 121 |
train_wo, train_w, train_lbl = [], [], []
|
| 122 |
for fp in trainpath:
|
| 123 |
wo, w, lbl = load_data(fp)
|
| 124 |
+
if lbl.dim() == 3:
|
| 125 |
+
lbl = lbl.unsqueeze(1)
|
| 126 |
train_wo.append(wo)
|
| 127 |
train_w.append(w)
|
| 128 |
train_lbl.append(lbl)
|
|
|
|
| 145 |
test_wo, test_w, test_lbl = [], [], []
|
| 146 |
for fp in testpath:
|
| 147 |
wo, w, lbl = load_data(fp)
|
| 148 |
+
if lbl.dim() == 3:
|
| 149 |
+
lbl = lbl.unsqueeze(1)
|
| 150 |
test_wo.append(wo)
|
| 151 |
test_w.append(w)
|
| 152 |
test_lbl.append(lbl)
|