Skip to content

Commit

Permalink
move online.json
Browse files Browse the repository at this point in the history
  • Loading branch information
shinkuan committed Apr 9, 2024
1 parent ce5c7f8 commit c5694fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mjai/bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, player_id: int):
with open(model_path, "rb") as f:
self.model_hash = hashlib.sha256(f.read()).hexdigest()
try:
with open(pathlib.Path(__file__).parent / "online.json", "r") as f:
with open(pathlib.Path(__file__).parent.parent / "online.json", "r") as f:
online_json = json.load(f)
self.online = online_json["online"]
if not self.online:
Expand Down
6 changes: 3 additions & 3 deletions mjai/bot/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import json
import gzip
import requests
import numpy as np
import torch
import pathlib
Expand All @@ -10,8 +12,6 @@
from functools import partial
from itertools import permutations
import riichi
import gzip
import requests

class ChannelAttention(nn.Module):
def __init__(self, channels, ratio=16, actv_builder=nn.ReLU, bias=True):
Expand Down Expand Up @@ -386,7 +386,7 @@ def get_engine() -> MortalEngine:
mortal.load_state_dict(state['mortal'])
dqn.load_state_dict(state['current_dqn'])

with open(pathlib.Path(__file__).parent / 'online.json', 'r') as f:
with open(pathlib.Path(__file__).parent.parent / 'online.json', 'r') as f:
json_load = json.load(f)
server = json_load['server']
online = json_load['online']
Expand Down
5 changes: 0 additions & 5 deletions mjai/bot/online.json

This file was deleted.

5 changes: 5 additions & 0 deletions mjai/online.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"server": "http://127.0.0.1:5000",
"online": false,
"api_key": "api_key"
}

0 comments on commit c5694fe

Please sign in to comment.