BounharAbdelaziz commited on
Commit
8d84cb6
·
verified ·
1 Parent(s): ad3a876

added access token

Browse files
Files changed (1) hide show
  1. human_eval.py +7 -8
human_eval.py CHANGED
@@ -11,6 +11,8 @@ import random
11
  import pandas as pd
12
  from collections import defaultdict
13
 
 
 
14
  def encode_image_to_base64(image_path):
15
  """Encode an image or GIF file to base64."""
16
  with open(image_path, "rb") as file:
@@ -275,16 +277,13 @@ def create_battle_arena(dataset_path, is_gif, is_causal):
275
  return demo
276
 
277
  if __name__ == "__main__":
278
-
279
- # load the existing dataset that contains outputs of the LMs
280
- human_eval_dataset = load_dataset("atlasia/LM-Moroccan-Darija-Bench", split='test').to_csv('human_eval_dataset.csv')
281
-
282
- # precision
283
- torch_dtype = torch.float16
284
 
285
- # inference device
286
- device = "cpu" #"cuda" if torch.cuda.is_available() else "cpu"
287
  dataset_path = 'human_eval_dataset.csv'
288
  is_gif = True
 
 
 
 
 
289
  demo = create_battle_arena(dataset_path, is_gif, is_causal=False)
290
  demo.launch(debug=True)
 
11
  import pandas as pd
12
  from collections import defaultdict
13
 
14
+ TOKEN = os.environ['TOKEN']
15
+
16
  def encode_image_to_base64(image_path):
17
  """Encode an image or GIF file to base64."""
18
  with open(image_path, "rb") as file:
 
277
  return demo
278
 
279
  if __name__ == "__main__":
 
 
 
 
 
 
280
 
 
 
281
  dataset_path = 'human_eval_dataset.csv'
282
  is_gif = True
283
+
284
+ # load the existing dataset that contains outputs of the LMs
285
+ human_eval_dataset = load_dataset("atlasia/LM-Moroccan-Darija-Bench", split='test', token=TOKEN).to_csv(dataset_path)
286
+
287
+ # load first tab for masked LM
288
  demo = create_battle_arena(dataset_path, is_gif, is_causal=False)
289
  demo.launch(debug=True)