polinaeterna HF staff commited on
Commit
a3b4e99
β€’
1 Parent(s): b858233
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -75,9 +75,9 @@ def plot_and_df(texts, preds):
75
  # counts.reset_index(inplace=True)
76
  return (
77
  gr.BarPlot(counts_df, x="quality", y="count", sort=None),
78
- texts_df[texts_df["quality"] == "Low"][["text"]][:20],
79
- texts_df[texts_df["quality"] == "Medium"][["text"]][:20],
80
- texts_df[texts_df["quality"] == "High"][["text"]][:20],
81
  )
82
 
83
 
@@ -99,6 +99,7 @@ def run_quality_check(dataset, config, split, column, batch_size, num_examples):
99
  return
100
 
101
  try:
 
102
  data = pl.read_parquet(f"hf://datasets/{dataset}@~parquet/{filename}", columns=[column])
103
  except Exception as error:
104
  yield f"❌ {error}", gr.BarPlot(), pd.DataFrame(), pd.DataFrame(), pd.DataFrame(), pd.DataFrame(),
 
75
  # counts.reset_index(inplace=True)
76
  return (
77
  gr.BarPlot(counts_df, x="quality", y="count", sort=None),
78
+ texts_df[texts_df["quality"] == "Low"][["text"]][:min(texts_df.shape[0], 20)],
79
+ texts_df[texts_df["quality"] == "Medium"][["text"]][:min(texts_df.shape[0], 20)],
80
+ texts_df[texts_df["quality"] == "High"][["text"]][:min(texts_df.shape[0], 20)],
81
  )
82
 
83
 
 
99
  return
100
 
101
  try:
102
+ logging.info(f"Loading hf://datasets/{dataset}@~parquet/{filename}")
103
  data = pl.read_parquet(f"hf://datasets/{dataset}@~parquet/{filename}", columns=[column])
104
  except Exception as error:
105
  yield f"❌ {error}", gr.BarPlot(), pd.DataFrame(), pd.DataFrame(), pd.DataFrame(), pd.DataFrame(),