Skip to content

Commit

Permalink
Remove R model
Browse files Browse the repository at this point in the history
  • Loading branch information
shinkuan committed Mar 7, 2024
1 parent 2fa6819 commit b6f5347
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion mjai/bot/key.txt

This file was deleted.

15 changes: 0 additions & 15 deletions mjai/bot/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ def __init__(
boltzmann_epsilon = 0,
boltzmann_temp = 1,
top_p = 1,
r = False,
key = "",
):
self.engine_type = 'mortal'
self.device = device or torch.device('cpu')
Expand All @@ -270,8 +268,6 @@ def __init__(
self.boltzmann_epsilon = boltzmann_epsilon
self.boltzmann_temp = boltzmann_temp
self.top_p = top_p
self.r = r
self.key = key

def react_batch(self, obs, masks, invisible_obs):
with (
Expand Down Expand Up @@ -340,15 +336,6 @@ def load_model(seat: int) -> riichi.mjai.Bot:
control_state_file = pathlib.Path(__file__).parent / control_state_file
state = torch.load(control_state_file, map_location=device)

key = ""
if 'r' in state['config']:
del state
from . import obfuscated_model
engine = obfuscated_model.IIIIIllllll()
return riichi.mjai.Bot(engine, seat)
else:
r = False

mortal = Brain(version=state['config']['control']['version'], conv_channels=state['config']['resnet']['conv_channels'], num_blocks=state['config']['resnet']['num_blocks']).eval()
dqn = DQN(version=state['config']['control']['version']).eval()
mortal.load_state_dict(state['mortal'])
Expand All @@ -364,8 +351,6 @@ def load_model(seat: int) -> riichi.mjai.Bot:
enable_rule_based_agari_guard = False,
name = 'mortal',
version = state['config']['control']['version'],
r = r,
key = key,
)

bot = riichi.mjai.Bot(engine, seat)
Expand Down

0 comments on commit b6f5347

Please sign in to comment.