lhoestq HF staff commited on
Commit
a33b08a
1 Parent(s): 3de98b2

don't crop output

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -377,7 +377,7 @@ with gr.Blocks(css=css, js=js) as demo:
377
  full_dataset_generation_success_html: "",
378
  }
379
  for row in stream_rewrite_dataset_preview_row_by_row(dataset=dataset, rows=rows, prompt=prompt, format=format):
380
- output_rows.append({k: json.dumps(row[k], ensure_ascii=False, default=crop_text) for k in output_format_df["column"]})
381
  yield {pretty_output_preview: gr.DataFrame(pd.DataFrame(output_rows))}
382
  yield {rewrite_full_dataset_button: gr.Button(interactive=True)}
383
  print(f"(preview) Done ReWriting {dataset} with instruction '{prompt}'")
@@ -406,7 +406,7 @@ with gr.Blocks(css=css, js=js) as demo:
406
  def run(i):
407
  for batch_rows in batched(parallel_input_rows[i], n=NUM_ROWS_PER_CALL):
408
  for row in stream_rewrite_dataset_row_by_row(dataset=dataset, rows=batch_rows, prompt=prompt, format=format):
409
- parallel_output_rows[i].append({k: json.dumps(row[k], ensure_ascii=False, default=crop_text) for k in output_format_df["column"]})
410
  yield 1
411
 
412
  current = 0
 
377
  full_dataset_generation_success_html: "",
378
  }
379
  for row in stream_rewrite_dataset_preview_row_by_row(dataset=dataset, rows=rows, prompt=prompt, format=format):
380
+ output_rows.append({k: json.dumps(row[k], ensure_ascii=False) for k in output_format_df["column"]})
381
  yield {pretty_output_preview: gr.DataFrame(pd.DataFrame(output_rows))}
382
  yield {rewrite_full_dataset_button: gr.Button(interactive=True)}
383
  print(f"(preview) Done ReWriting {dataset} with instruction '{prompt}'")
 
406
  def run(i):
407
  for batch_rows in batched(parallel_input_rows[i], n=NUM_ROWS_PER_CALL):
408
  for row in stream_rewrite_dataset_row_by_row(dataset=dataset, rows=batch_rows, prompt=prompt, format=format):
409
+ parallel_output_rows[i].append({k: json.dumps(row[k], ensure_ascii=False) for k in output_format_df["column"]})
410
  yield 1
411
 
412
  current = 0