loubnabnl HF staff commited on
Commit
1662e36
1 Parent(s): 2f7b0b5

fix nan extension

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,12 +13,13 @@ tags = {}
13
  for index, row in df.iterrows():
14
  if row["language"] not in tags:
15
  tags[row["language"]] = []
16
- tags[row["language"]].append(row["extension"])
17
  all_languages = list(tags.keys())
18
 
19
 
20
  @st.cache(max_entries=100)
21
  def load_data(language, ext, min_alphanum, max_line_length, max_mean_line_length, non_lexable):
 
22
  samples = load_dataset(
23
  "loubnabnl/the-stack-inspection-data",
24
  data_dir=f"data/{language}/{ext}",
 
13
  for index, row in df.iterrows():
14
  if row["language"] not in tags:
15
  tags[row["language"]] = []
16
+ tags[row["language"]].append(str(row["extension"]))
17
  all_languages = list(tags.keys())
18
 
19
 
20
  @st.cache(max_entries=100)
21
  def load_data(language, ext, min_alphanum, max_line_length, max_mean_line_length, non_lexable):
22
+ ext = None if ext == "nan" else ext
23
  samples = load_dataset(
24
  "loubnabnl/the-stack-inspection-data",
25
  data_dir=f"data/{language}/{ext}",