HaileyStorm commited on
Commit
ae3133e
1 Parent(s): 537ea5c

Update chess-gpt-eval-contrastive/main.py

Browse files
Files changed (1) hide show
  1. chess-gpt-eval-contrastive/main.py +14 -22
chess-gpt-eval-contrastive/main.py CHANGED
@@ -625,30 +625,22 @@ def play_games(
625
  illegal_move_numbers
626
  )
627
  games_saved += 1
628
- else:
629
- print("Duplicate game; not saved.")
630
 
631
- if update_activations:
632
- if player_one_resignation or player_one_failed_to_find_legal_move:
633
- player_one.update_activations("lost")
634
- #player_two.update_activations("won")
635
- elif player_two_resignation or player_two_failed_to_find_legal_move:
636
- player_one.update_activations("won")
637
- #player_two.update_activations("lost")
638
- else:
639
- if board.result() == "1-0":
640
- player_one.update_activations("won")
641
- # player_two.update_activations("lost")
642
- elif board.result() == "0-1":
643
  player_one.update_activations("lost")
644
- # player_two.update_activations("won")
645
- #else: # Draw
646
- # player_one.update_activations("draw")
647
- # player_two.update_activations("draw")
 
 
 
648
 
649
- if games_saved % save_activations_every == 0:
650
- player_one.save_activations(activations_path)
651
- #player_two.save_activations(activations_path)
 
652
 
653
  if isinstance(player_one, StockfishPlayer):
654
  player_one.close()
@@ -689,7 +681,7 @@ save_activations_every = 25
689
  if __name__ == "__main__":
690
  for nanogpt_player in player_ones:
691
  for i in [0]: # [3] #range(11):
692
- num_games = 2500
693
  # player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
694
  # player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
695
  # player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")
 
625
  illegal_move_numbers
626
  )
627
  games_saved += 1
 
 
628
 
629
+ if update_activations:
630
+ if player_one_resignation or player_one_failed_to_find_legal_move:
 
 
 
 
 
 
 
 
 
 
631
  player_one.update_activations("lost")
632
+ elif player_two_resignation or player_two_failed_to_find_legal_move:
633
+ player_one.update_activations("won")
634
+ else:
635
+ if board.result() == "1-0":
636
+ player_one.update_activations("won")
637
+ elif board.result() == "0-1":
638
+ player_one.update_activations("lost")
639
 
640
+ if games_saved % save_activations_every == 0:
641
+ player_one.save_activations(activations_path)
642
+ else:
643
+ print("Duplicate game; not saved.")
644
 
645
  if isinstance(player_one, StockfishPlayer):
646
  player_one.close()
 
681
  if __name__ == "__main__":
682
  for nanogpt_player in player_ones:
683
  for i in [0]: # [3] #range(11):
684
+ num_games = 2500-65
685
  # player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
686
  # player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
687
  # player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")