Skip to content

Commit

Permalink
Moved BBA so it is not being called on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorvaldAagaard committed Nov 5, 2023
1 parent b1be5c4 commit 6e2ffb3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ Below is a list of features which aren't implemented in this engine yet, but you
howpublished = {\url{https://github.com/lorserker/ben}},
}
```

On Mac i use python3 and pip3
6 changes: 5 additions & 1 deletion src/appserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

script_dir = os.path.dirname(os.path.abspath(__file__))

@app.route('/')
@app.route('/home')
def home():
html = '<h1><a href="/app/bridge.html">Play Now</a></h1>\n'
Expand Down Expand Up @@ -66,5 +67,8 @@ def delete_deal(deal_id):
db.close()
redirect('/home')

print(f'http://localhost:{port}/home')

run(app, host='localhost', port=port, server='gevent', log=None)


run(app, host='0.0.0.0', port=port, server='gevent')
6 changes: 3 additions & 3 deletions src/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import human
import bots
import conf
from bba.BBA import BBABotBid

from sample import Sample
from bidding import bidding
Expand Down Expand Up @@ -455,6 +454,7 @@ async def bidding(self):
players = []
for i, level in enumerate(self.human):
if level == 99:
from bba.BBA import BBABotBid
players.append(BBABotBid(1,1,i,hands_str[i],vuln, self.dealer_i))
elif level == 1:
players.append(self.factory.create_human_bidder(vuln, hands_str[i]))
Expand Down Expand Up @@ -565,8 +565,8 @@ async def main():
# Default to version 1. of Tensorflow
from nn.models import Models


models = Models.from_conf(configuration, base_path.replace("\src",""))
print(base_path)
models = Models.from_conf(configuration, base_path.replace("/src",""))

driver = Driver(models, human.ConsoleFactory(), Sample.from_conf(configuration, verbose), verbose)

Expand Down
2 changes: 1 addition & 1 deletion src/gameserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_execution_path():
# Default to version 1. of Tensorflow
from nn.models import Models

models = Models.from_conf(configuration, base_path.replace("\src",""))
models = Models.from_conf(configuration, base_path.replace("/src",""))

print('models loaded')

Expand Down

0 comments on commit 6e2ffb3

Please sign in to comment.