HaileyStorm commited on
Commit
6645dae
1 Parent(s): 7c10311

Upload chess-gpt-eval/main.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. chess-gpt-eval/main.py +9 -8
chess-gpt-eval/main.py CHANGED
@@ -260,7 +260,8 @@ def record_results(
260
  write_headers = not os.path.exists(csv_file_path)
261
 
262
  # Append the results to the CSV file
263
- with open(csv_file_path, "a", newline="") as csv_file: # THIS WAS APPEND
 
264
  writer = csv.DictWriter(csv_file, fieldnames=info_dict.keys())
265
  if write_headers:
266
  writer.writeheader()
@@ -535,30 +536,30 @@ MAX_MOVES = 999 # Due to nanogpt max input length of 1024
535
  recording_file = "logs/determine.csv" # default recording file. Because we are using list [player_ones], recording_file is overwritten
536
  # player_one_recording_name = "ckpt_8.pt"
537
  #player_ones = ["ckpt_iter_20000.pt","ckpt_iter_40000.pt","ckpt_iter_60000.pt","ckpt_iter_80000.pt"] #["ckpt.pt"]
538
- player_ones = ["Xformer/6.6M/ckpt.pt"]
539
  player_two_recording_name = "lc0_sweep" #"stockfish_sweep"
540
  move_num_in_gamestate = False
541
  if __name__ == "__main__":
542
  for nanogpt_player in player_ones:
543
  player_one_recording_name = nanogpt_player
544
- for i in range(2): #range(11):
545
- num_games = 265 #265 instead of 250 for duplicates (for lc0, stockfish doesn't need it)
546
  # player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
547
  # player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
548
  # player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")
549
  # player_one = GPTPlayer(model="gpt-4")
550
  # player_one = StockfishPlayer(skill_level=-1, play_time=0.1)
551
 
552
- player_one = NanoGptPlayer(model_name=player_one_recording_name, move_num_in_gamestate=False)
553
- # player_one = MambaPlayer(model_name=player_one_recording_name, move_num_in_gamestate=False)
554
  #player_two = StockfishPlayer(skill_level=i, play_time=0.1)
555
  player_two = LC0PLayer(skill=i)
556
 
557
  # player_two = GPTPlayer(model="gpt-4")
558
  # player_two = GPTPlayer(model="gpt-3.5-turbo-instruct")
559
 
560
- print(f"\n\nSTARTING GAMES AGAINST STOCKFISH LEVEL {i}\n\n")
561
- #print(f"\n\nSTARTING GAMES AGAINST LC0 LEVEL {i}\n\n")
562
 
563
  play_game(player_one, player_two, num_games, random_opening_seed=True)
564
 
 
260
  write_headers = not os.path.exists(csv_file_path)
261
 
262
  # Append the results to the CSV file
263
+ os.makedirs(os.path.dirname(csv_file_path), exist_ok=True)
264
+ with open(csv_file_path, "a", newline="") as csv_file:
265
  writer = csv.DictWriter(csv_file, fieldnames=info_dict.keys())
266
  if write_headers:
267
  writer.writeheader()
 
536
  recording_file = "logs/determine.csv" # default recording file. Because we are using list [player_ones], recording_file is overwritten
537
  # player_one_recording_name = "ckpt_8.pt"
538
  #player_ones = ["ckpt_iter_20000.pt","ckpt_iter_40000.pt","ckpt_iter_60000.pt","ckpt_iter_80000.pt"] #["ckpt.pt"]
539
+ player_ones = ["50M/ckpt_9715500b.pt"]
540
  player_two_recording_name = "lc0_sweep" #"stockfish_sweep"
541
  move_num_in_gamestate = False
542
  if __name__ == "__main__":
543
  for nanogpt_player in player_ones:
544
  player_one_recording_name = nanogpt_player
545
+ for i in range(1): #range(11):
546
+ num_games = 100 #265 #265 instead of 250 for duplicates (for lc0, stockfish doesn't need it)
547
  # player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
548
  # player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
549
  # player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")
550
  # player_one = GPTPlayer(model="gpt-4")
551
  # player_one = StockfishPlayer(skill_level=-1, play_time=0.1)
552
 
553
+ #player_one = NanoGptPlayer(model_name=player_one_recording_name, move_num_in_gamestate=False)
554
+ player_one = MambaPlayer(model_name=player_one_recording_name, move_num_in_gamestate=False)
555
  #player_two = StockfishPlayer(skill_level=i, play_time=0.1)
556
  player_two = LC0PLayer(skill=i)
557
 
558
  # player_two = GPTPlayer(model="gpt-4")
559
  # player_two = GPTPlayer(model="gpt-3.5-turbo-instruct")
560
 
561
+ #print(f"\n\nSTARTING GAMES AGAINST STOCKFISH LEVEL {i}\n\n")
562
+ print(f"\n\nSTARTING GAMES AGAINST LC0 LEVEL {i}\n\n")
563
 
564
  play_game(player_one, player_two, num_games, random_opening_seed=True)
565