guyar commited on
Commit
c2ac1bf
1 Parent(s): 31baa45

fix: adjust faction name when loading model so can find file

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -136,7 +136,7 @@ def display_map(faction, map):
136
  def predict(*args):
137
  Xdata, faction = args_to_features(*args)
138
 
139
- modelfile = f'{os.getcwd()}/data/faction-picker-bot/models/{faction}_model.txt'
140
  bst = lgb.Booster(model_file=modelfile)
141
 
142
  return f'Final score: {round(bst.predict(Xdata)[0])}'
@@ -144,7 +144,7 @@ def predict(*args):
144
 
145
  def interpret(*args):
146
  Xdata, faction = args_to_features(*args)
147
- modelfile = f'{os.getcwd()}/data/faction-picker-bot/models/{faction}_model.txt'
148
  bst = lgb.Booster(model_file=modelfile)
149
  bst.params["objective"] = "regression"
150
  explainer = shap.Explainer(bst)
 
136
  def predict(*args):
137
  Xdata, faction = args_to_features(*args)
138
 
139
+ modelfile = f'{os.getcwd()}/data/faction-picker-bot/models/{faction.lower()}_model.txt'
140
  bst = lgb.Booster(model_file=modelfile)
141
 
142
  return f'Final score: {round(bst.predict(Xdata)[0])}'
 
144
 
145
  def interpret(*args):
146
  Xdata, faction = args_to_features(*args)
147
+ modelfile = f'{os.getcwd()}/data/faction-picker-bot/models/{faction.lower()}_model.txt'
148
  bst = lgb.Booster(model_file=modelfile)
149
  bst.params["objective"] = "regression"
150
  explainer = shap.Explainer(bst)