zhuchi76 commited on
Commit
e5e68d6
·
verified ·
1 Parent(s): 2d020de

Update script to hub

Browse files
Files changed (1) hide show
  1. Boat_dataset.py +1 -3
Boat_dataset.py CHANGED
@@ -160,10 +160,8 @@ class BoatDataset(datasets.GeneratorBasedBuilder):
160
  def _generate_examples(self, filepath, split):
161
  with open(filepath, encoding="utf-8") as f:
162
  for key, row in enumerate(f):
163
- if not row.strip(): # Skip empty lines
164
- continue
165
  try:
166
- data = json.loads(row)
167
  # Proceed to use 'data' for generating examples
168
  yield key, {
169
  "image_id": data["image_id"],
 
160
  def _generate_examples(self, filepath, split):
161
  with open(filepath, encoding="utf-8") as f:
162
  for key, row in enumerate(f):
 
 
163
  try:
164
+ data = json.loads(row.strip())
165
  # Proceed to use 'data' for generating examples
166
  yield key, {
167
  "image_id": data["image_id"],