eckendoerffer commited on
Commit
33d50e4
1 Parent(s): 3c0f7fc

Update explore_dataset.py

Browse files
Files changed (1) hide show
  1. explore_dataset.py +2 -3
explore_dataset.py CHANGED
@@ -37,7 +37,6 @@ def build_index():
37
 
38
  with open(path_index, 'w', encoding="utf8") as f:
39
  json.dump(index, f)
40
- return index
41
 
42
  def get_line(file_path, line_number, index, i):
43
  """
@@ -56,10 +55,10 @@ def get_line(file_path, line_number, index, i):
56
 
57
  # Build index if it doesn't exist
58
  if not os.path.exists(path_index):
59
- index = build_index()
60
 
61
  # Load the index file
62
- with open(path_index, 'r', encoding='utf-8') as file:
63
  index = json.load(file)
64
 
65
  # Display 10 random lines from the dataset
 
37
 
38
  with open(path_index, 'w', encoding="utf8") as f:
39
  json.dump(index, f)
 
40
 
41
  def get_line(file_path, line_number, index, i):
42
  """
 
55
 
56
  # Build index if it doesn't exist
57
  if not os.path.exists(path_index):
58
+ build_index()
59
 
60
  # Load the index file
61
+ with open(path_index, 'r') as file:
62
  index = json.load(file)
63
 
64
  # Display 10 random lines from the dataset