alisrbdni commited on
Commit
a9af20d
·
verified ·
1 Parent(s): 09b13a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -391,7 +391,6 @@
391
 
392
  # if __name__ == "__main__":
393
  # main()
394
-
395
  import streamlit as st
396
  import matplotlib.pyplot as plt
397
  import torch
@@ -428,7 +427,7 @@ def load_data(dataset_name, train_size=20, test_size=20, num_clients=2, use_utf8
428
  tokenized_datasets = tokenized_datasets.rename_column("label", "labels")
429
  else:
430
  def utf8_encode_function(examples):
431
- examples["text"] = [text.encode('utf-8') for text in examples["text"]]
432
  return examples
433
 
434
  tokenized_datasets = raw_datasets.map(utf8_encode_function, batched=True)
 
391
 
392
  # if __name__ == "__main__":
393
  # main()
 
394
  import streamlit as st
395
  import matplotlib.pyplot as plt
396
  import torch
 
427
  tokenized_datasets = tokenized_datasets.rename_column("label", "labels")
428
  else:
429
  def utf8_encode_function(examples):
430
+ examples["input_ids"] = [list(text.encode('utf-8')) for text in examples["text"]]
431
  return examples
432
 
433
  tokenized_datasets = raw_datasets.map(utf8_encode_function, batched=True)