Skip to content

Commit

Permalink
Fix cfg(global variable) > utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chizuchizu committed Mar 25, 2021
1 parent 5756ee2 commit ff3ccb2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

client = FixstarsClient()

cfg = None

def init_client(cfg):

def init_client(_cfg):
global cfg
cfg = _cfg.copy()
# APIキーの取得
with open(cfg.base.api_key_path) as f:
with open(_cfg.base.api_key_path) as f:
client.token = json.load(f)["AMPLIFY_TOKEN"]
client.parameters.timeout = cfg.model.timeout
client.parameters.timeout = _cfg.model.timeout


def get_weight(w, k):
Expand Down Expand Up @@ -101,7 +105,7 @@ def model(cfg, data, label):
return q_result


def train_fn(cfg, ds):
def train_fn(ds):
data = ds[0]
label = ds[1]

Expand Down

0 comments on commit ff3ccb2

Please sign in to comment.