fixed bug
Browse files- ref_seg_ger.py +4 -1
ref_seg_ger.py
CHANGED
|
@@ -235,13 +235,16 @@ class RefSeg(datasets.GeneratorBasedBuilder):
|
|
| 235 |
for input_id in tokenized_input['input_ids']:
|
| 236 |
input_ids.append(input_id)
|
| 237 |
labels.append('O')
|
| 238 |
-
|
| 239 |
input_ids.append(tokenized_input['input_ids'])
|
| 240 |
if row['tag'] == 'O':
|
| 241 |
labels.append(row['tag'])
|
| 242 |
else:
|
| 243 |
labels.append(row['tag'] + '-' + row['label'])
|
|
|
|
|
|
|
| 244 |
|
|
|
|
| 245 |
for chunk_id, index in enumerate(range(0, len(input_ids), self.CHUNK_SIZE)):
|
| 246 |
split_ids = input_ids[index:index + self.CHUNK_SIZE]
|
| 247 |
#split_bboxes = bboxes[index:index + self.CHUNK_SIZE]
|
|
|
|
| 235 |
for input_id in tokenized_input['input_ids']:
|
| 236 |
input_ids.append(input_id)
|
| 237 |
labels.append('O')
|
| 238 |
+
elif len(tokenized_input['input_ids']) == 1:
|
| 239 |
input_ids.append(tokenized_input['input_ids'])
|
| 240 |
if row['tag'] == 'O':
|
| 241 |
labels.append(row['tag'])
|
| 242 |
else:
|
| 243 |
labels.append(row['tag'] + '-' + row['label'])
|
| 244 |
+
else:
|
| 245 |
+
continue
|
| 246 |
|
| 247 |
+
print('got all')
|
| 248 |
for chunk_id, index in enumerate(range(0, len(input_ids), self.CHUNK_SIZE)):
|
| 249 |
split_ids = input_ids[index:index + self.CHUNK_SIZE]
|
| 250 |
#split_bboxes = bboxes[index:index + self.CHUNK_SIZE]
|